Skip to content

Commit

Permalink
Fix bug in case REQUEST_URI does not contain the tests path
Browse files Browse the repository at this point in the history
 Refs #3722
  • Loading branch information
mattab committed Feb 7, 2013
1 parent f26d1d1 commit 477c338
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/PHPUnit/IntegrationTestCase.php
Expand Up @@ -565,7 +565,10 @@ public static function getRootUrl()
$pathBeforeRoot = 'plugins';
}

$piwikUrl = substr($piwikUrl, 0, strpos($piwikUrl, $pathBeforeRoot.'/'));
$testsInPath = strpos($piwikUrl, $pathBeforeRoot.'/');
if($testsInPath !== false) {
$piwikUrl = substr($piwikUrl, 0, $testsInPath);
}
return $piwikUrl;
}

Expand Down
4 changes: 3 additions & 1 deletion tests/PHPUnit/bootstrap.php
Expand Up @@ -64,7 +64,9 @@ function checkPiwikSetupForTests()
$expectedString = 'plugins/CoreHome/templates/images/favicon.ico';

if(strpos($fetched, $expectedString) === false) {
echo "\nPiwik should be running at: " . $piwikServerUrl . "\nbut this URL returned an unexpected response: '". $fetched . "'\n\n";
echo "\nPiwik should be running at: " . $piwikServerUrl
. "\nbut this URL returned an unexpected response: '"
. substr($fetched,0,300) . "...'\n\n";
exit;
}
}

0 comments on commit 477c338

Please sign in to comment.