本文整理汇总了PHP中PHPUnit_Framework_TestSuite::count方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_TestSuite::count方法的具体用法?PHP PHPUnit_Framework_TestSuite::count怎么用?PHP PHPUnit_Framework_TestSuite::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_TestSuite
的用法示例。
在下文中一共展示了PHPUnit_Framework_TestSuite::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startTestSuite
/**
* A test suite started.
*
* @param \PHPUnit_Framework_TestSuite $suite
*
* @return void
*/
public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
{
$suiteName = $suite->getName();
$testCount = $suite->count();
$context = array('suiteName' => $suiteName, 'testCount' => $testCount, 'operation' => __FUNCTION__);
$this->suites[] = $suiteName;
$this->stats[$suiteName] = array('tests' => 0, 'assertions' => 0, 'failures' => 0, 'errors' => 0, 'incompletes' => 0, 'skips' => 0, 'risky' => 0);
$this->logger->notice(sprintf("TestSuite '%s' started with %d tests.", $suiteName, $testCount), $context);
}
示例2: buildAndAddSuiteFromDirectory2
public static function buildAndAddSuiteFromDirectory2($parentSuite, $name, $directoryName, $whatToTest)
{
assert('is_string($directoryName) && $directoryName != ""');
if (is_dir($directoryName)) {
$suite = new PHPUnit_Framework_TestSuite();
$suite->setName(ucfirst($name) . ' Tests');
$fileNames = scandir($directoryName);
foreach ($fileNames as $fileName) {
if (substr($fileName, strlen($fileName) - strlen('Test.php')) == 'Test.php') {
require_once "{$directoryName}/{$fileName}";
$className = substr($fileName, 0, strlen($fileName) - 4);
if (substr($className, strlen($className) - 8) != 'BaseTest') {
if ($whatToTest == 'All' || $whatToTest == 'Framework' && $name == 'Framework' || $whatToTest == 'Misc' && $name == 'Misc' || $whatToTest == 'BadDependencies' && $name == 'BadDependencies' || $whatToTest == $name || $whatToTest == $className) {
if (@class_exists($className, false)) {
$suite->addTestSuite(new PHPUnit_Framework_TestSuite($className));
static::resolveDependentTestModelClassNamesForClass($className, $directoryName);
}
}
}
}
}
if ($suite->count() > 0) {
$parentSuite->addTestSuite($suite);
}
}
}
示例3: runAllTests
/**
* Runs all tests.
*
* @param PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases suite with all test cases
* @param PHPUnit_Framework_TestResult $testResult the test result (will be modified)
*
* @return void
*/
protected function runAllTests(PHPUnit_Framework_TestSuite $testSuiteWithAllTestCases, PHPUnit_Framework_TestResult $testResult)
{
$this->testListener->setTotalNumberOfTests($testSuiteWithAllTestCases->count());
$this->renderProgressbar();
$testSuiteWithAllTestCases->run($testResult);
}