public function testStoreSuccessWithRedirectToList()
 {
     $object = new Event();
     $object->id = 1;
     Event::shouldReceive('create')->once()->andReturn($object);
     $input = ['start_date' => '2014-03-10', 'end_date' => '2014-03-10', 'exit' => true];
     $this->call('POST', 'admin/events', $input);
     $this->assertRedirectedToRoute('admin.events.index');
 }
 public function boot()
 {
     // Bring in the routes
     require __DIR__ . '/../routes.php';
     // Add dirs
     View::addLocation(__DIR__ . '/../Views');
     Lang::addNamespace('events', __DIR__ . '/../lang');
     Config::addNamespace('events', __DIR__ . '/../config');
     // Observers
     EventTranslation::observe(new SlugObserver());
     Event::observe(new FileObserver());
 }
Exemple #3
0
 public function boot()
 {
     $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'typicms.events');
     $modules = $this->app['config']['typicms']['modules'];
     $this->app['config']->set('typicms.modules', array_merge(['events' => ['linkable_to_page']], $modules));
     $this->loadViewsFrom(__DIR__ . '/../resources/views/', 'events');
     $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'events');
     $this->publishes([__DIR__ . '/../resources/views' => base_path('resources/views/vendor/events')], 'views');
     $this->publishes([__DIR__ . '/../database' => base_path('database')], 'migrations');
     AliasLoader::getInstance()->alias('Events', 'TypiCMS\\Modules\\Events\\Facades\\Facade');
     // Observers
     EventTranslation::observe(new SlugObserver());
     Event::observe(new FileObserver());
 }