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