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