public function testStoreSuccessWithRedirectToList() { $object = new StdClass(); $object->id = 1; Place::shouldReceive('create')->once()->andReturn($object); $input = array('title' => 'test', 'slug' => 'test', 'status' => 0, 'exit' => true); $this->call('POST', 'admin/places', $input); $this->assertRedirectedToRoute('admin.places.index'); }
public function boot() { // Bring in the routes require __DIR__ . '/../routes.php'; // Add dirs View::addLocation(__DIR__ . '/../Views'); Lang::addNamespace('places', __DIR__ . '/../lang'); Config::addNamespace('places', __DIR__ . '/../config'); // Observers Place::observe(new FileObserver()); }
public function boot() { $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'typicms.places'); $modules = $this->app['config']['typicms']['modules']; $this->app['config']->set('typicms.modules', array_merge(['places' => ['linkable_to_page']], $modules)); $this->loadViewsFrom(__DIR__ . '/../resources/views/', 'places'); $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'places'); $this->publishes([__DIR__ . '/../resources/views' => base_path('resources/views/vendor/places')], 'views'); $this->publishes([__DIR__ . '/../database' => base_path('database')], 'migrations'); $this->publishes([__DIR__ . '/../../resources/assets' => public_path()], 'scripts'); AliasLoader::getInstance()->alias('Places', 'TypiCMS\\Modules\\Places\\Facades\\Facade'); // Observers PlaceTranslation::observe(new SlugObserver()); Place::observe(new FileObserver()); }