public function setUp() { parent::setUp(); App::build(['Model' => [CakePlugin::path('Tools') . 'Test' . DS . 'test_app' . DS . 'Model' . DS]], App::RESET); $this->Comment = ClassRegistry::init('BitmaskedComment'); $this->Comment->Behaviors->load('Tools.Bitmasked', ['mappedField' => 'statuses']); }
public function setUp() { parent::setUp(); Configure::write('Routing.prefixes', ['admin']); Router::reload(); $this->Html = new HtmlExtHelper(new View(null)); }
public function setUp() { parent::setUp(); $this->CustomFinds = new CustomFindsBehavior(); $this->Model = new CustomFindsTest(); $this->Model->customFinds = array('topSellers' => array('fields' => array('Product.name', 'Product.price'), 'contain' => array('ProductImage.source'), 'conditions' => array('Product.countSeller >' => 20, 'Product.is_active' => 1), 'recursive' => 1)); }
public function setUp() { parent::setUp(); $this->ResetBehavior = new ResetBehavior(); $this->Model = ClassRegistry::init('MyComment'); $this->Model->Behaviors->load('Tools.Reset'); }
public function setUp() { parent::setUp(); $this->KeyValueBehavior = new KeyValueBehavior(); $this->Model = ClassRegistry::init('User'); $this->Model->Behaviors->load('Tools.KeyValue'); }
public function setUp() { parent::setUp(); Configure::delete('Localization'); $this->Model = ClassRegistry::init('PaymentMethod'); $this->Model->Behaviors->load('Tools.DecimalInput', ['fields' => ['rel_rate', 'set_rate'], 'output' => true]); }
public function setUp() { parent::setUp(); $this->Model = ClassRegistry::init('TestImap'); $config = []; $this->Imap = new TestImapSource($config); }
public function setUp() { $this->Model = ClassRegistry::init('Country'); $this->db = ConnectionManager::getDataSource('test'); $this->skipIf(!$this->db instanceof Mysql, 'The subquery test is only compatible with Mysql.'); parent::setUp(); }
public function setUp() { parent::setUp(); Router::reload(); $this->View = new View(); $this->Flash = new FlashHelper($this->View); }
public function setUp() { parent::setUp(); Configure::write('Localization', array('decimals' => ',', 'thousands' => '.')); NumberLib::config(); $this->Numeric = new NumericHelper(new View(null)); }
public function setUp() { parent::setUp(); Configure::delete('Localization'); $this->Model = ClassRegistry::init('PaymentMethod'); $this->Model->Behaviors->load('Tools.NumberFormat', array('fields' => array('rel_rate', 'set_rate'), 'output' => true)); }
/** * SetUp method * * @return void */ public function setUp() { parent::setUp(); Configure::delete('Typography.locale'); Configure::write('App.language', 'eng'); $this->Typography = new TypographyHelper(new View(null)); }
public function setUp() { $this->InlineCss = new InlineCssLib(['engine' => InlineCssLib::ENGINE_CSS_TO_INLINE]); $result = App::import('Vendor', 'Tools.CssToInlineStyles', ['file' => 'CssToInlineStyles' . DS . 'CssToInlineStyles.php']); $this->skipIf(!$result); parent::setUp(); }
public function setUp() { parent::setUp(); //$this->skipIf(!file_exists(APP . 'Config' . DS . 'email.php'), 'no email.php'); Configure::write('Email.live', false); $this->Email = new TestEmailLib(); }
public function setUp() { parent::setUp(); $this->Flattr = new FlattrHelper(new View(null)); $this->Flattr->Html = new HtmlHelper(new View(null)); $this->uid = '1234'; }
public function setUp() { parent::setUp(); $this->MultipleDisplayFieldsBehavior = new MultipleDisplayFieldsBehavior(); $this->Comment = ClassRegistry::init('Comment'); $this->Comment->bindModel(['belongsTo' => ['User']], false); $this->Comment->displayField = 'comment'; }
/** * PwdShellTest::setUp() * * @return void */ public function setUp() { parent::setUp(); $output = new TestConsoleOutput(); $error = $this->getMock('ConsoleOutput', array(), array(), '', false); $input = $this->getMock('ConsoleInput', array(), array(), '', false); $this->PwdShell = new PwdShell($output, $error, $input); }
public function setUp() { parent::setUp(); if ($this->isDebug()) { Configure::write('Hazard.debug', true); } $this->HazardLib = new TestHazardLib(); }
public function setUp() { parent::setUp(); $this->skipIf(!function_exists('imap_open'), 'No Imap class installed'); $this->skipIf(!Configure::read('Mailbox.DEVTEST'), 'No test account `DEVTEST` available'); $this->Imap = new ImapLib(); $this->testFilePath = APP . 'Test' . DS . 'test_files' . DS; }
public function setUp() { parent::setUp(); Router::reload(); $View = new View(null); $this->Common = new CommonHelper($View); $this->Html = new CommonHelper($View); }
public function setUp() { parent::setUp(); $this->ZipLib = new ZipLib(); foreach ($this->testFiles as $file => $content) { $this->_createTestFile($file, $content); } }
public function setUp() { parent::setUp(); //Configure::write('Googl.key', 'YOUR KEY'); $this->Googl = new TestGooglLib(); if ($this->isDebug()) { $this->Googl->setLive(); } }
public function setUp() { parent::setUp(); $output = new TestConsoleOutput(); $error = $this->getMock('ConsoleOutput', [], [], '', false); $input = $this->getMock('ConsoleInput', [], [], '', false); $this->EncodingShell = new TestEncodingShell($output, $error, $input); $this->EncodingShell->initialize(); $this->EncodingShell->startup(); }
public function setUp() { parent::setUp(); if ($this->isDebug()) { $this->skipIf(!Configure::read('Mailchimp.apiKey'), 'No API key'); } else { Configure::write('Mailchimp.apiKey', 'foo-bar'); } $this->MailchimpAppModel = new MailchimpAppModel(); }
public function setUp() { parent::setUp(); $this->NamedScopeBehavior = new NamedScopeBehavior(); $this->Comment = ClassRegistry::init('Comment'); $this->Comment->bindModel(array('belongsTo' => array('User')), false); $this->Comment->displayField = 'comment'; $this->Comment->Behaviors->load('Tools.NamedScope'); $this->Comment->User->Behaviors->load('Tools.NamedScope'); }
/** * Initial Tree * * - One * -- One-SubA * - Two * -- Two-SubA * --- Two-SubA-1 * ---- Two-SubA-1-1 * - Three * - Four * -- Four-SubA * */ public function setUp() { parent::setUp(); $this->Tree = new TreeHelper(new View(null)); $this->Model = ClassRegistry::init('AfterTree'); $this->Model->Behaviors->load('Tree'); $this->Model->truncate(); $data = array(array('name' => 'One'), array('name' => 'Two'), array('name' => 'Three'), array('name' => 'Four'), array('name' => 'One-SubA', 'parent_id' => 1), array('name' => 'Two-SubA', 'parent_id' => 2), array('name' => 'Four-SubA', 'parent_id' => 4), array('name' => 'Two-SubA-1', 'parent_id' => 6), array('name' => 'Two-SubA-1-1', 'parent_id' => 8)); foreach ($data as $row) { $this->Model->create(); $this->Model->save($row); } }
public function setUp() { parent::setUp(); if ($this->isDebug()) { $this->skipIf(!Configure::read('Mailchimp.apiKey'), 'No API key'); } else { Configure::write('Mailchimp.apiKey', 'foo-bar'); } $this->Mailchimp = new Mailchimp(); if (!$this->isDebug()) { $this->Mailchimp->Mailchimp = $this->getMock('MailchimpLib', ['_get']); $this->mockPath = CakePlugin::path('Mailchimp') . 'Test' . DS . 'test_files' . DS . 'mailchimp' . DS; } }
public function setUp() { parent::setUp(); $this->SortableBehavior = new SortableBehavior(); $this->Model = ClassRegistry::init('Role'); $this->Model->Behaviors->load('Tools.Sortable'); // Reset order $list = $this->_getList(); $count = count($list); foreach ($list as $id => $order) { $this->Model->id = $id; $this->Model->saveField('sort', $count); $count--; } }
public function setUp() { parent::setUp(); $this->Diff = new DiffLib(); $style = <<<CSS <style type="text/css"> del { \tcolor: red; } ins { \tcolor: green; } </style> CSS; $this->out($style, true); }
/** * SetUp method */ public function setUp() { parent::setUp(); $this->Diff = new DiffHelper(new View(null)); $this->Diff->Html = new HtmlHelper(new View(null)); $style = <<<CSS <style type="text/css"> del { \tcolor: red; } ins { \tcolor: green; } </style> CSS; $this->out($style); }