本文整理汇总了PHP中AbstractTest::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractTest::setUp方法的具体用法?PHP AbstractTest::setUp怎么用?PHP AbstractTest::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractTest
的用法示例。
在下文中一共展示了AbstractTest::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
$this->_result = $this->_test->assert->getResult();
$this->_package = $this->_test->assert->php;
$this->_testFilesDir = dirname(__FILE__) . '/_files';
}
示例2: setUp
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: setUp
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: setUp
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: setUp
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: setUp
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: setUp
protected function setUp()
{
parent::setUp();
$this->_qos = $this->_test->assert->qos;
}
示例8: setUp
protected function setUp()
{
parent::setUp();
$this->_package = $this->_test->assert->php->pear;
}
示例9: setUp
protected function setUp()
{
parent::setUp();
$this->_package = $this->_test->assert->cpu->performance;
}
示例10: setUp
/**
* 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: setUp
public function setUp()
{
parent::setUp();
$this->_targetLocator = new TargetLocator($this->_driver);
}
示例12: setUp
protected function setUp()
{
parent::setUp();
$this->_package = $this->_test->assert->shell;
}
示例13: setUp
public function setUp()
{
parent::setUp();
$this->_alert = new Alert($this->_driver);
}
示例14: setUp
protected function setUp()
{
parent::setUp();
$this->_adapter = new phpRack_Adapters_Notifier_Mail_Sendmail();
}
示例15: setUp
public function setUp()
{
parent::setUp();
global $phpRackConfig;
$this->_runner = new phpRack_Runner($phpRackConfig);
}