本文整理匯總了PHP中CacheUtil::createCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP CacheUtil::createCache方法的具體用法?PHP CacheUtil::createCache怎麽用?PHP CacheUtil::createCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CacheUtil
的用法示例。
在下文中一共展示了CacheUtil::createCache方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: endTestSuite
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
{
$cache = new CacheUtil();
// if there were failed tests hand off to CacheUtil
if (!empty($this->failedTests)) {
$cache->createCache($this->failedTests, $_SERVER['argv']);
} else {
// delete cache file if all tests passed
$cache->deleteCache($_SERVER['argv']);
}
}
示例2: testCreateAndReadCache
public function testCreateAndReadCache()
{
$cache = new CacheUtil();
$test1 = new RerunRandomTest();
$test2 = new RerunRandomTest();
$failedTestsToWrite = array(array('testMethodName' => $test1->getName(), 'testClassName' => get_class($test1)), array('testMethodName' => $test2->getName(), 'testClassName' => get_class($test2)));
$cmdOptions = array('phpunit', 'testName');
$cache->createCache($failedTestsToWrite, $cmdOptions);
$key = $cache->generateKey($cmdOptions);
$failedTestsFromFile = $cache->readCache($key);
$this->assertEquals($failedTestsToWrite, $failedTestsFromFile, 'Test written to file differ from those read from file');
}