/**
  * Setup method.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Router::plugin('DebugKit', function ($routes) {
         $routes->connect('/toolbar/clear_cache/*', ['plugin' => 'DebugKit', 'controller' => 'Toolbar', 'action' => 'clearCache']);
     });
 }
 /**
  * setUp method. Creates a temporary swagger.php configuration file
  * specific to this integration test.
  */
 public function setUp()
 {
     parent::setUp();
     $configTemplate = APP . 'config' . DS . 'swagger.php.docs.custom_route';
     $this->tempConfig = APP . 'config' . DS . 'swagger.php';
     copy($configTemplate, $this->tempConfig);
 }
 /**
  * Setup method.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Router::plugin('DebugKit', function ($routes) {
         $routes->connect('/toolbar/:action/*', ['controller' => 'Requests']);
     });
 }
 public function setUp()
 {
     parent::setUp();
     $this->image = ROOT . DS . APP_DIR . DS . 'Plugin' . DS . 'Media' . DS . 'Test' . DS . 'testHelper.png';
     $this->Medias = TableRegistry::get('Medias', ['className' => 'Media\\Model\\Table\\MediasTable']);
     //$this->Media->expects($this->any())->method('move_uploaded_file')->will($this->returnCallback('test_move_uploaded_file'));
 }
 /**
  * Setup method.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Router::plugin('DebugKit', function ($routes) {
         $routes->connect('/panels/:action/*', ['controller' => 'Panels']);
     });
 }
Beispiel #6
0
 /**
  * setUp
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $password = password_hash('password', PASSWORD_DEFAULT);
     $Users = TableRegistry::get('Users');
     $Users->updateAll(['password' => $password], []);
 }
 /**
  * setUp method.
  */
 public function setUp()
 {
     parent::setUp();
     $configTemplate = APP . 'config' . DS . 'swagger.php.ui.default_routes';
     $this->tempConfig = APP . 'config' . DS . 'swagger.php';
     copy($configTemplate, $this->tempConfig);
 }
 public function setUp()
 {
     parent::setUp();
     $this->session(['Auth' => ['User' => ['id' => 1, 'name' => 'testing', 'email' => '*****@*****.**', 'created' => new Time('2015-10-13 12:13:14'), 'modified' => new Time('2014-11-14 13:14:15'), 'modified' => new Time('2014-11-14 13:14:15'), 'lastLogin' => new Time('2015-10-11 10:11:12')]]]);
     $this->data = ['name' => 'Pranas', 'email' => '*****@*****.**', 'password' => 'ADAaaksdj23'];
     $this->users = TableRegistry::get('Users');
     $this->user = $this->users->get(1);
 }
 /**
  * Setup
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Logs = TableRegistry::get('DatabaseLog.DatabaseLogs');
     if (!$this->Logs->find()->count()) {
         $this->Logs->log('warning', 'Foo Warning', ['x' => 'y']);
     }
 }
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $eventManagerInstance = EventManager::instance();
     parent::setUp();
     EventManager::instance($eventManagerInstance);
     $this->session(mockUserSession());
     include QUICKAPPS_CORE . '/config/routes_site.php';
 }
 /**
  * setUp method
  *
  * It will set the needed Tables.
  */
 public function setUp()
 {
     parent::setUp();
     $config = TableRegistry::exists('Todos') ? [] : ['className' => 'App\\Model\\Table\\TodosTable'];
     $this->Todos = TableRegistry::get('Todos', $config);
     $config = TableRegistry::exists('Users') ? [] : ['className' => 'App\\Model\\Table\\UsersTable'];
     $this->Users = TableRegistry::get('Users', $config);
 }
 /**
  * Setup method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('App.namespace', 'TestApp');
     Router::connect('/:controller/:action/*', [], ['routeClass' => 'InflectedRoute']);
     DispatcherFactory::clear();
     DispatcherFactory::add('Routing');
     DispatcherFactory::add('ControllerFactory');
 }
 public function setUp()
 {
     parent::setUp();
     $this->session(['Auth' => ['User' => ['id' => 1, 'username' => 'Phil']]]);
     $this->configRequest(['headers' => ['Accept' => 'application/json']]);
     $this->Threads = TableRegistry::get('Threads');
     $this->Threads->hasMany('Messages');
     $this->Threads->Messages->hasMany('MessageReadStatuses');
 }
 /**
  * [setUp description]
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->resetReflectionCache();
     $this->_eventManager = EventManager::instance();
     $existing = Configure::read('App.paths.templates');
     $existing[] = Plugin::path('Crud') . 'tests/App/Template/';
     Configure::write('App.paths.templates', $existing);
 }
 public function setUp()
 {
     parent::setUp();
     $this->session(['Auth' => ['User' => ['id' => 1, 'name' => 'testing', 'email' => '*****@*****.**', 'created' => new Time('2015-10-13 12:13:14'), 'modified' => new Time('2014-11-14 13:14:15'), 'modified' => new Time('2014-11-14 13:14:15'), 'lastLogin' => new Time('2015-10-11 10:11:12')]]]);
     $this->data = ['name' => 'UAB Septyni Zuikiai', 'address' => 'Zenono g. 45, Kaunas', 'phoneNumber' => '+370 780 343 56', 'email' => '*****@*****.**', 'corporateId' => '7676542', 'user_id' => 1];
     $this->customers = TableRegistry::get('Customers');
     $this->users = TableRegistry::get('Users');
     $this->customer = $this->customers->get(1);
     $this->user = $this->users->get(1);
 }
 public function setUp()
 {
     parent::setUp();
     $this->Medias = TableRegistry::get('TestPictures');
     $this->image = ROOT . DS . 'plugins' . DS . 'Media' . DS . 'tests' . DS . 'testHelper.png';
     $Medias = $this->getMock('MediasController', array('canUploadMedias'));
     $Medias->expects($this->any())->method('move_uploaded_file')->will($this->returnCallback('test_move_uploaded_file'));
     $Medias->expects($this->any())->method('canUploadMedias')->will($this->returnValue(true));
     $this->controller = $this->getMock('App\\Controller\\MediasController');
 }
 /**
  * SetUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $config = TableRegistry::exists('UsersTypeMissions') ? [] : ['className' => 'App\\Model\\Table\\UsersTypeMissionsTable'];
     $this->UsersTypeMissions = TableRegistry::get('UsersTypeMissions', $config);
     $config = TableRegistry::exists('Users') ? [] : ['className' => 'App\\Model\\Table\\UsersTable'];
     $this->Users = TableRegistry::get('Users', $config);
     $config = TableRegistry::exists('Visits') ? [] : ['className' => 'App\\Model\\Table\\VisitsTable'];
     $this->Visits = TableRegistry::get('Visits', $config);
 }
 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     // Setup our component and fake test controller
     $collection = new ComponentRegistry();
     $this->WhosOnline = new WhosOnlineComponent($collection);
     $this->Controller = $this->getMock('Cake\\Controller\\Controller', ['redirect']);
     $this->WhosOnline->setController($this->Controller);
     $this->Users = TableRegistry::get('CakeManager.Users');
     $this->Usermetas = TableRegistry::get('WhosOnline.Usermetas');
 }
 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Users = TableRegistry::get('CakeManager.Users');
     $user = $this->Users->newEntity();
     $user->email = '*****@*****.**';
     $user->active = 1;
     $user->role_id = 1;
     $user->password = '******';
     $this->Users->save($user);
 }
 public function setUp()
 {
     parent::setUp();
     $this->image = TMP . 'testHelper.png';
     $this->resizedImage = TMP . 'testHelper_50x50.jpg';
     $config = TableRegistry::exists('Medias') ? [] : ['className' => 'Media\\Model\\Table\\MediasTable'];
     $this->Medias = TableRegistry::get('Medias', $config);
     $this->Medias = $this->getMockForModel('Media.Medias', array('move_uploaded_file'));
     $this->Medias->expects($this->any())->method('move_uploaded_file')->will($this->returnCallback([$this, 'testMoveUploadedFile']));
     $this->Posts = TableRegistry::get('Posts');
 }
 /**
  * [setUp description]
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->resetReflectionCache();
     $this->_eventManager = EventManager::instance();
     $existing = Configure::read('App.paths.templates');
     $existing[] = Plugin::path('Crud') . 'tests/App/Template/';
     Configure::write('App.paths.templates', $existing);
     Configure::write('App.namespace', 'Crud\\Test\\App');
     Router::extensions('json');
     Router::connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);
     Router::connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);
     $this->useHttpServer(false);
 }
 public function setUp()
 {
     parent::setUp();
     $this->session(['Auth' => ['User' => ['id' => 1, 'name' => 'testing', 'email' => '*****@*****.**', 'created' => new Time('2015-10-13 12:13:14'), 'modified' => new Time('2014-11-14 13:14:15'), 'modified' => new Time('2014-11-14 13:14:15'), 'lastLogin' => new Time('2015-10-11 10:11:12')]]]);
     $this->data = ['title' => 'New Title', 'description' => 'New description.', 'users' => ['_ids' => [1, 2]], 'customers' => ['_ids' => [1, 3]]];
     $this->data2 = ['title' => 'Another Title', 'description' => 'Another description.', 'users' => ['_ids' => [2]], 'customers' => ['_ids' => [2]]];
     $this->customers = TableRegistry::get('Customers');
     $this->users = TableRegistry::get('Users');
     $this->meetings = TableRegistry::get('Meetings');
     $this->customer = $this->customers->get(1);
     $this->user = $this->users->get(1);
     $this->post('/meetings/add', $this->data);
     //create a new meeting. Not in fixture, because this way join tables get populated.
     $this->post('/meetings/add', $this->data2);
     // same as above.
     $this->meeting = $this->meetings->get(1);
 }
 /**
  * Setup the test case, backup the static object values so they can be restored.
  * Specifically backs up the contents of Configure and paths in App if they have
  * not already been backed up.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Ips = TableRegistry::get('TestApp.Ips');
     $this->Ips->schema()->columnType('ip', 'ip');
     Router::scope('/', function ($routes) {
         $routes->connect('/ips', ['controller' => 'Ips']);
         $routes->connect('/ips/add', ['controller' => 'Ips', 'action' => 'add']);
         $routes->connect('/ips/edit/:id', ['controller' => 'Ips', 'action' => 'edit'], ['pass' => ['id']]);
         $routes->connect('/ips/edit_when_always/:id', ['controller' => 'Ips', 'action' => 'editWhenAlways'], ['pass' => ['id']]);
         $routes->connect('/ips/edit_when_bad_value/:id', ['controller' => 'Ips', 'action' => 'editWhenBadValue'], ['pass' => ['id']]);
         $routes->connect('/ips/add_other_field', ['controller' => 'Ips', 'action' => 'addOtherField']);
         $routes->connect('/ips/edit_other_field/:id', ['controller' => 'Ips', 'action' => 'editOtherField'], ['pass' => ['id']]);
         $routes->connect('/ips/edit_other_field_when_always/:id', ['controller' => 'Ips', 'action' => 'editOtherFieldWhenAlways'], ['pass' => ['id']]);
         $routes->connect('/ips/edit_other_field_when_bad_value/:id', ['controller' => 'Ips', 'action' => 'editOtherFieldWhenBadValue'], ['pass' => ['id']]);
         $routes->connect('/ips/add_two_fields', ['controller' => 'Ips', 'action' => 'addTwoFields']);
         $routes->connect('/ips/edit_two_fields/:id', ['controller' => 'Ips', 'action' => 'editTwoFields'], ['pass' => ['id']]);
     });
 }
 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Users = TableRegistry::get('CakeManager.Users');
 }
 public function setUp()
 {
     parent::setUp();
     $this->usersFixture = new UsersFixture();
 }
Beispiel #26
0
 /**
  * SetUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $config = TableRegistry::exists('Notifications') ? [] : ['className' => 'App\\Model\\Table\\NotificationsTable'];
     $this->Notifications = TableRegistry::get('Notifications', $config);
 }
 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Users = TableRegistry::get('Users');
     $this->Threads = TableRegistry::get('Threads');
 }
 public function setUp()
 {
     parent::setUp();
 }
 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->session(['Auth' => ['User' => ['id' => 100]]]);
 }
 /**
  * Test index method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->markTestIncomplete('Not implemented yet.');
 }