本文整理汇总了PHP中SimpleTest::run方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleTest::run方法的具体用法?PHP SimpleTest::run怎么用?PHP SimpleTest::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTest
的用法示例。
在下文中一共展示了SimpleTest::run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: warmup
/**
* Runs an empty test to determine the benchmark overhead and run each test once
*/
private function warmup()
{
$warmup = new SimpleTest('warmup', function () {
});
$warmup->run();
foreach ($this->tests as $test) {
$test->run();
}
$this->base_results = $warmup->run($this->n);
}
示例2: testSpecificSequence
function testSpecificSequence()
{
$mock =& new MockDummy($this);
$mock->setExpectedArgumentsSequence(1, "aMethod", array(1, 2, 3));
$mock->setExpectedArgumentsSequence(2, "aMethod", array("Hello"));
$mock->aMethod();
$mock->aMethod(1, 2, 3);
$mock->aMethod("Hello");
$mock->aMethod();
}
function testFailedSequence()
{
$test =& new MockTestCase($this);
$test->setExpectedArguments("assertTrue", array(false, "*"));
$mock =& new MockDummy($test);
$mock->setExpectedArgumentsSequence(0, "aMethod", array(1, 2, 3));
$mock->setExpectedArgumentsSequence(1, "aMethod", array("Hello"));
$mock->aMethod(1, 2);
$mock->aMethod("Goodbye");
}
}
$test = new SimpleTest("Mock components test");
$test->addTestCase(new TestOfParameterList());
$test->addTestCase(new TestOfCallMap());
$test->addTestCase(new TestOfCodeGeneration());
$test->addTestCase(new TestOfMockReturns());
$test->addTestCase(new TestOfMockTally());
$test->addTestCase(new TestOfMockExpectations());
$test->attachObserver(new TestHtmlDisplay());
$test->run();