本文整理汇总了PHP中UnitTestCase类的典型用法代码示例。如果您正苦于以下问题:PHP UnitTestCase类的具体用法?PHP UnitTestCase怎么用?PHP UnitTestCase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UnitTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTestCase
public function addTestCase(UnitTestCase $testCase)
{
if ($testCase instanceof GroupTest) {
$this->_testCases = array_merge($this->_testCases, $testCase->getTestCases());
} else {
$this->_testCases[get_class($testCase)] = $testCase;
}
}
示例2: test_AkActiveRecord_actAsTree
function test_AkActiveRecord_actAsTree()
{
parent::UnitTestCase();
$this->_createNewTestingModelDatabase('AkTestCategory');
$this->_createNewTestingModel('AkTestCategory');
$this->_createNewTestingModel('AkDependentTestCategory');
}
示例3: run
/**
* Uses reflection to run every method within itself
* starting with the string "test" unless a method
* is specified.
* @param SimpleReporter $reporter Current test reporter.
* @return boolean True if all tests passed.
* @access public
*/
function run(&$reporter)
{
$this->setUpFixture();
$ret = parent::run($reporter);
$this->tearDownFixture();
return $ret;
}
示例4: Date
/**
* The constructor method.
*/
function __construct()
{
$oServiceLocator =& OA_ServiceLocator::instance();
$oNow = new Date('2008-04-01 12:30:00');
$oServiceLocator->register('now', $oNow);
parent::__construct();
}
示例5: rand
/**
* The constructor method.
*/
function __construct()
{
parent::__construct();
Mock::generate('OA_Dal_Maintenance_Priority', $this->mockDal = 'MockOA_Dal_Maintenance_Priority' . rand());
Mock::generatePartial('OA_Maintenance_Priority_AdServer_Task_PriorityCompensation', 'PartialMock_OA_Maintenance_Priority_AdServer_Task_PriorityCompensation', array('_getDal', '_getOperationIntUtils', '_getMaxEntityAdObject'));
Mock::generatePartial('OA_Maintenance_Priority_Ad', 'PartialOA_Maintenance_Priority_Ad', array());
}
示例6: tempnam
function __construct()
{
parent::__construct();
$username = 'cctm';
$password = 'cctm';
$login_url = 'http://cctm:8888/wp-login.php';
$this->ckfile = tempnam('/tmp', 'CURLCOOKIE');
$post_data = array();
$post_data['log'] = $username;
$post_data['pwd'] = $password;
foreach ($post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
$post_string = implode('&', $post_items);
$ch = curl_init($login_url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $this->ckfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($ch);
curl_close($ch);
}
示例7: array
/**
* The class constructor method.
*/
function __construct()
{
parent::__construct();
Mock::generate('MAX_Dal_Entities');
Mock::generate('OA_Dal_Maintenance_Priority');
Mock::generatePartial('OX_Maintenance_Priority_Campaign', 'MockPartialOX_Maintenance_Priority_Campaign', array('_abort'));
}
示例8: setUp
function setUp()
{
// @todo mock the tokenizer
$this->proc = new Elgg_Ecml_Processor(new Elgg_Ecml_Tokenizer());
elgg_register_plugin_hook_handler('view', 'output/text', 'ecml_process_view');
parent::setUp();
}
示例9: setUp
function setUp()
{
parent::setUp();
$this->factory = TestHelper::getPartialMock('Tracker_CrossSearch_SharedFieldFactory', array('getDao'));
$this->dao = new MockTracker_CrossSearch_SharedFieldDao();
$this->factory->setReturnValue('getDao', $this->dao);
}
示例10: tearDown
public function tearDown()
{
parent::tearDown();
unset($GLOBALS['sys_force_ssl']);
unset($GLOBALS['sys_default_domain']);
unset($GLOBALS['sys_https_host']);
}
示例11: tearDown
function tearDown()
{
if (file_exists($this->cache_file)) {
unlink($this->cache_file);
}
parent::tearDown();
}
示例12: SimpleRunner
function &_createRunner(&$reporter)
{
if ($this->_isDebugging())
return new SimpleRunner($this, $reporter);
return parent::_createRunner($reporter);
}
示例13: array
/**
* The constructor method.
*/
function __construct()
{
parent::__construct();
$this->oDbh = OA_DB::singleton();
$this->oCache = new OA_DB_XmlCache();
$this->oSchema =& MDB2_Schema::factory($this->oDbh, array('force_defaults' => false));
}
示例14: __construct
public function __construct()
{
$this->environ = new MongoTestEnvironment();
$this->environ->clean();
$this->save = array();
parent::__construct();
}
示例15:
function __construct()
{
parent::__construct();
$c = new Naf_UnitTestDbConnection();
$this->connection = $c->getConnection();
Naf_Table::setDefaultConnection($this->connection);
}