Fixing test cases in HtmlHelperTest for command line testing and removing function aliases from CodeCoverageManager

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6790 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2008-05-10 16:42:35 +00:00
parent 9982a30eea
commit b8f0e80f7d
2 changed files with 57 additions and 58 deletions

View file

@ -175,7 +175,7 @@ class HtmlHelperTest extends CakeTestCase {
Configure::write('Asset.timestamp', true);
$result = $this->Html->css('cake.generic');
$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]+/';
$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]*/';
$this->assertTags($result, $expected);
$debug = Configure::read('debug');
@ -186,7 +186,7 @@ class HtmlHelperTest extends CakeTestCase {
Configure::write('Asset.timestamp', 'force');
$result = $this->Html->css('cake.generic');
$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]+/';
$expected['link']['href'] = 'preg:/.*css\/cake\.generic\.css\?[0-9]*/';
$this->assertTags($result, $expected);
Configure::write('Asset.timestamp', false);

View file

@ -96,8 +96,7 @@ class CodeCoverageManager {
$manager =& CodeCoverageManager::getInstance();
$manager->reporter = $reporter;
$thisFile = r('.php', '.test.php', basename(__FILE__));
$thisFile = str_replace('.php', '.test.php', basename(__FILE__));
if (strpos($testCaseFile, $thisFile) !== false) {
trigger_error('Xdebug supports no parallel coverage analysis - so this is not possible.', E_USER_ERROR);
}
@ -282,7 +281,7 @@ class CodeCoverageManager {
if (strpos($lines[$key], 'end') !== false) {
$foundEndBlockInContextSearch = true;
if ($j < $numContextLines) {
$lines[$key] = r('end', '', $lines[$key-1]);
$lines[$key] = str_replace('end', '', $lines[$key-1]);
}
}
@ -300,7 +299,7 @@ class CodeCoverageManager {
$lineBeforeIsUncovered = strpos($lines[$key-1], 'uncovered') !== false;
if (!$foundEndBlockInContextSearch && !$lineBeforeIsUncovered && ($lineBeforeIsEndBlock)) {
$lines[$key-1] = r('end', '', $lines[$key-1]);
$lines[$key-1] = str_replace('end', '', $lines[$key-1]);
}
if (!$lineBeforeIsShown && !$lineBeforeIsUncovered) {
@ -490,7 +489,7 @@ class CodeCoverageManager {
}
$testManager =& new TestManager();
$testFile = r($testManager->_testExtension, '.php', $file);
$testFile = str_replace($testManager->_testExtension, '.php', $file);
// if this is a file from the test lib, we cannot find the test object file in /cake/libs
// but need to search for it in /cake/test/lib
@ -548,7 +547,7 @@ class CodeCoverageManager {
);
$replacements = array(DS, '', '');
$file = preg_replace($patterns, $replacements, $file);
$file = r("'", '', $file);
$file = str_replace("'", '', $file);
$result[] = $manager->__testObjectFileFromCaseFile($file, $isApp).'.php';
}