コード例 #1
0
ファイル: LintTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_result = $this->_test->assert->getResult();
     $this->_package = $this->_test->assert->php;
     $this->_testFilesDir = dirname(__FILE__) . '/_files';
 }
コード例 #2
0
ファイル: AbstractTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_result = $this->_test->assert->getResult();
     $this->_package = $this->_test->assert->disc->file;
     $this->_testFilesDir = PHPRACK_PATH . '/../test/phpRack/Package/Disc/_files';
 }
コード例 #3
0
 protected function setUp()
 {
     parent::setUp();
     $this->groups['groupA'] = uniqid('groupA_');
     $this->groups['groupB'] = uniqid('groupB_');
     $jobWithGroupA = Mage::getModel('aoe_scheduler/job');
     /* @var $jobWithGroupA Aoe_Scheduler_Model_Job */
     $jobWithGroupA->setScheduleCronExpr('always');
     $jobWithGroupA->setJobCode(uniqid('t_job_'));
     $jobWithGroupA->setRunModel('aoe_scheduler/task_test::run');
     $jobWithGroupA->setGroups($this->groups['groupA']);
     $jobWithGroupA->setIsActive(true);
     $jobWithGroupA->save();
     $this->jobs['jobWithGroupA'] = $jobWithGroupA;
     $jobWithGroupB = Mage::getModel('aoe_scheduler/job');
     /* @var $jobWithGroupB Aoe_Scheduler_Model_Job */
     $jobWithGroupB->setScheduleCronExpr('always');
     $jobWithGroupB->setJobCode(uniqid('t_job_'));
     $jobWithGroupB->setRunModel('aoe_scheduler/task_test::run');
     $jobWithGroupB->setGroups($this->groups['groupB']);
     $jobWithGroupB->setIsActive(true);
     $jobWithGroupB->save();
     $this->jobs['jobWithGroupB'] = $jobWithGroupB;
     $jobWithGroupAandB = Mage::getModel('aoe_scheduler/job');
     /* @var $jobWithGroupAandB Aoe_Scheduler_Model_Job */
     $jobWithGroupAandB->setScheduleCronExpr('always');
     $jobWithGroupAandB->setJobCode(uniqid('t_job_'));
     $jobWithGroupAandB->setRunModel('aoe_scheduler/task_test::run');
     $jobWithGroupAandB->setGroups("{$this->groups['groupA']},{$this->groups['groupB']}");
     $jobWithGroupAandB->setIsActive(true);
     $jobWithGroupAandB->save();
     $this->jobs['jobWithGroupAandB'] = $jobWithGroupAandB;
     // fake schedule generation to avoid it to be generated on the next run:
     Mage::app()->saveCache(time(), Mage_Cron_Model_Observer::CACHE_KEY_LAST_SCHEDULE_GENERATE_AT, array('crontab'), null);
 }
コード例 #4
0
 public function setUp()
 {
     parent::setUp();
     $this->_navigationMock = $this->getMock('Navigation', array('refresh', 'to', 'back', 'forward'));
     $this->_windowMock = $this->getMock('Window', array('maximize', 'close', 'setSize', 'getSize', 'setPosition', 'getPosition'));
     $this->_targetLocatorMock = $this->getMock('TargetLocator', array('window', 'frame'));
     $this->_originalNavigate = $this->_driver->navigate();
     $this->_originalWindow = $this->_driver->manage()->window();
     $this->_originalTargetLocator = $this->_driver->switchTo();
 }
コード例 #5
0
ファイル: ConfigTest.php プロジェクト: rafalwrzeszcz/zf2
 public function setUp()
 {
     parent::setUp();
     $this->_configProvider = new ProviderConfig();
     $this->_configProvider->setRegistry($this->_registry);
     // Store original autoloaders
     $this->loaders = spl_autoload_functions();
     if (!is_array($this->loaders)) {
         // spl_autoload_functions does not return empty array when no
         // autoloaders registered...
         $this->loaders = array();
     }
     // Store original include_path
     $this->includePath = get_include_path();
 }
コード例 #6
0
 public function setUp()
 {
     parent::setUp();
     Tests_DBLoader4Test::getUp();
     //        MemcacheHandler::getInstance( array( '127.0.0.1:11211' => 1 ) )->flush();
     self::$dummyTmKey_key = "fookey";
     self::$dummyTmKey_owner = 1;
     self::$dummyTmKey_r = 1;
     self::$dummyTmKey_w = 0;
     self::$dummyTmKey_uid_transl = 123;
     self::$dummyTmKey_r_transl = 0;
     self::$dummyTmKey_w_transl = 1;
     self::$dummyTmKey_edit = true;
     self::$uid_translator = 123;
     self::$validJsonTmKeyArr = '[{"tm":true,"glos":false,"owner":true,"uid_transl":null,"uid_rev":null,"name":"My personal Key","key":"993dddb1c603b4e57f69","r":"1","w":"0","r_transl":null,"w_transl":null,"r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$invalidJsonTmKeyArr = '[{tm":true,"glos":true"owner":true,"uid_transl":null,"uid_rev":null,"name":"My personal Key","key":"993dddb1c603b4e57f69","r":"1","w":"0","r_transl":null,"w_transl":null,"r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$validJsonTmKeyArrWithUidTranslator = '[{"tm":true,"glos":false,"owner":false,"uid_transl":123,"uid_rev":null,"name":"My personal Key","key":"993dddb1c603b4e57f69","r":"1","w":"0","r_transl":"1","w_transl":"1","r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$invalidClientJson = '[{name""My personal Key","key":"993dddb1c603b4e57f69","r":"1","w":"0"}]';
     self::$validClientJson = '[{"name":"My personal Key","key":"993dddb1c603b4e57f69","r":"1","w":"0"},{"name":"My second Key","key":"testclientKey","r":"1","w":"1"}]';
     self::$invalidServerJson = '[{tm":true,"glos":true"owner":true,"uid_transl":null,"uid_rev":null,"name":"My personal Key","key":"993dddb1c603b4e57f69","r":"1","w":"0","r_transl":null,"w_transl":null,"r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$validServerJson = '[{"tm":true,"glos":true,"owner":true,"uid_transl":null,"uid_rev":null,"name":"My personal Key","key":"993dddb1c603b4e57f69","r":"1","w":"0","r_transl":null,"w_transl":null,"r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$invalidGrantString = "invalidGrantString";
     self::$invalidTypeString = "invalidTypeString";
     self::$invalidRoleString = "invalidRoleString";
     $newTm = array();
     $newTm['key'] = sha1(chr(rand(97, 122)));
     $newTm['owner'] = $newTm['key'] & 1;
     $newTm['r'] = $newTm['key'][5] & 1;
     $newTm['w'] = $newTm['key'][12] & 1;
     $newTm['r_transl'] = $newTm['key'][2] & 1;
     $newTm['w_transl'] = $newTm['key'][4] & 1;
     $newTm['uid_transl'] = rand(1, 1024);
     self::$validTmKeyStructArr = $newTm;
     self::$invalidTmKeyStructArr = self::$validTmKeyStructArr;
     self::$invalidTmKeyStructArr['invalidField'] = 'invalidField';
     self::$srv_json_ABC = '[{"tm":true,"glos":false,"owner":true,"key":"0000123ABC","name":"","r":"1","w":"1","uid_transl":123,"uid_rev":null,"r_transl":1,"w_transl":0,"r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$srv_json_GHI = '[{"tm":true,"glos":false,"owner":true,"key":"0000123GHI","name":"My GHI","r":"1","w":"1","uid_transl":null,"uid_rev":null,"r_transl":null,"w_transl":null,"r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$srv_json_ABC_GHI_DEF = '[{"tm":true,"glos":false,"owner":true,"key":"0000123ABC","name":"My ABC","r":"1","w":"1","uid_transl":123,"uid_rev":null,"r_transl":1,"w_transl":0,"r_rev":null,"w_rev":null,"source":null,"target":null},' . '{"tm":true,"glos":false,"owner":true,"key":"0000123GHI","name":"My GHI","r":"1","w":"1","uid_transl":null,"uid_rev":null,"r_transl":null,"w_transl":null,"r_rev":null,"w_rev":null,"source":null,"target":null},' . '{"tm":true,"glos":false,"owner":false,"key":"0000123DEF","name":"My DEF","r":null,"w":null,"uid_transl":123,"uid_rev":null,"r_transl":1,"w_transl":1,"r_rev":null,"w_rev":null,"source":null,"target":null}]';
     self::$client_json_ABC = '[{"key":"0000123ABC","name":"My DEF","r":1,"w":1}]';
     self::$client_json_ABC_DEF = '[{"key":"0000123ABC","name":"My ABC","r":1,"w":1},' . '{"key":"0000123DEF","name":"My DEF","r":1,"w":0}]';
     self::$client_json_DEF = '[{"key":"0000123DEF","name":"My DEF","r":1,"w":0}]';
     self::$client_json_GHI_DEF = '[{"key":"*****23GHI","name":"My GHI","r":1,"w":1},' . '{"key":"0000123DEF","name":"My DEF","r":1,"w":0}]';
     //the second key is invalid, we expect unchanged in server side
     self::$client_json_ABC_GHI_JKL = '[{"key":"0000123ABC","name":"My ABC","r":1,"w":1},' . '{"key":"*****23GHI","name":"My GHI","r":1,"w":0},' . '{"key":"0000123JKL","name":"My JKL","r":1,"w":0}]';
     self::$client_json_GHI = '[{"key":"0000123GHI","name":"My GHI","r":0,"w":1}]';
     self::$client_json_INVALID_GHI = '[{"key":"0000123GHI","name":"My GHI","r":0,"w":0}]';
 }
コード例 #7
0
ファイル: LatencyTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_qos = $this->_test->assert->qos;
 }
コード例 #8
0
ファイル: PearTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_package = $this->_test->assert->php->pear;
 }
コード例 #9
0
ファイル: PerformanceTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_package = $this->_test->assert->cpu->performance;
 }
コード例 #10
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->labelFactory = new \Nonogram\Label\Factory(new \Nonogram\Label\LabelProviderCells());
     $this->labelFactory->setContainer($this->container);
 }
コード例 #11
0
 public function setUp()
 {
     parent::setUp();
     $this->_targetLocator = new TargetLocator($this->_driver);
 }
コード例 #12
0
ファイル: ShellTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_package = $this->_test->assert->shell;
 }
コード例 #13
0
 public function setUp()
 {
     parent::setUp();
     $this->_alert = new Alert($this->_driver);
 }
コード例 #14
0
ファイル: SendmailTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_adapter = new phpRack_Adapters_Notifier_Mail_Sendmail();
 }
コード例 #15
0
ファイル: RunnerTest.php プロジェクト: tpc2/phprack
 public function setUp()
 {
     parent::setUp();
     global $phpRackConfig;
     $this->_runner = new phpRack_Runner($phpRackConfig);
 }
コード例 #16
0
ファイル: AbstractTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_adapter = new phpRack_Adapters_Db_Mysql();
 }
コード例 #17
0
ファイル: CpuTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_adapter = phpRack_Adapters_Cpu::factory();
 }
コード例 #18
0
ファイル: PhpTest.php プロジェクト: tpc2/phprack
 protected function setUp()
 {
     parent::setUp();
     $this->_package = $this->_test->assert->php;
     $this->_result = $this->_test->assert->getResult();
 }
コード例 #19
0
ファイル: MemoryTest.php プロジェクト: avz-cmf/zaboy-rest
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->object = $this->container->get('testMemory');
 }