public function testStoreSuccessWithRedirectToList()
 {
     $object = new StdClass();
     $object->id = 1;
     Contact::shouldReceive('create')->once()->andReturn($object);
     $input = array('title' => 'mr', 'first_name' => 'John', 'last_name' => 'Doe', 'email' => '*****@*****.**', 'message' => 'Hello', 'my_time' => Crypt::encrypt(time() - 60), 'exit' => true);
     $this->call('POST', 'admin/contacts', $input);
     $this->assertRedirectedToRoute('admin.contacts.index');
 }
예제 #2
0
 public function boot()
 {
     // Bring in the routes
     require __DIR__ . '/../routes.php';
     // Add dirs
     View::addLocation(__DIR__ . '/../Views');
     Lang::addNamespace('contacts', __DIR__ . '/../lang');
     Config::addNamespace('contacts', __DIR__ . '/../config');
     // Observers
     Contact::observe(new FileObserver());
 }
예제 #3
0
 public function boot()
 {
     $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'typicms.contacts');
     $modules = $this->app['config']['typicms']['modules'];
     $this->app['config']->set('typicms.modules', array_merge(['contacts' => ['linkable_to_page']], $modules));
     $this->loadViewsFrom(__DIR__ . '/../resources/views/', 'contacts');
     $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'contacts');
     $this->publishes([__DIR__ . '/../resources/views' => base_path('resources/views/vendor/contacts')], 'views');
     $this->publishes([__DIR__ . '/../database' => base_path('database')], 'migrations');
     // Honeypot facade
     AliasLoader::getInstance()->alias('Honeypot', 'Msurguy\\Honeypot\\HoneypotFacade');
     // Observers
     Contact::observe(new FileObserver());
 }