Skip to content

Commit

Permalink
trying to fix some errors refs #3722
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Feb 8, 2013
1 parent 1d7d29b commit 5e3b044
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
13 changes: 1 addition & 12 deletions tests/PHPUnit/Core/JsProxyTest.php
Expand Up @@ -44,17 +44,6 @@ function testPiwikPhp()
*/
private function getStaticSrvUrl()
{
$path = Piwik_Url::getCurrentScriptPath();
if (substr($path, -7) == '/tests/') {
$path = substr($path, 0, -7);
} else {
if (substr($path, -18) == '/tests/core/Piwik/') {
$path = substr($path, 0, -18);
} else {
throw new Exception('unsupported test path: ' . $path);
}
}

return "http://" . $_SERVER['HTTP_HOST'] . $path;
return IntegrationTestCase::getRootUrl();
}
}
16 changes: 4 additions & 12 deletions tests/PHPUnit/Core/ServeStaticFileTest.php
Expand Up @@ -12,7 +12,7 @@
*/

// This is Piwik logo, the static file used in this test suit
define("TEST_FILE_LOCATION", dirname(__FILE__) . "/../../resources/lipsum.txt");
define("TEST_FILE_LOCATION", realpath(dirname(__FILE__) . "/../../resources/lipsum.txt"));
define("TEST_FILE_CONTENT_TYPE", "text/plain");

// Defines http request parameters
Expand Down Expand Up @@ -388,18 +388,10 @@ public function test_compressionCacheInvalidation()
*/
private function getStaticSrvUrl()
{
$path = Piwik_Url::getCurrentScriptPath();
if (substr($path, -7) == '/tests/') {
$path .= 'resources/';
} else {
if (substr($path, -18) != '/tests/core/Piwik/') {
throw new Exception('unsupported test path: ' . $path);
}
}
$url = IntegrationTestCase::getRootUrl();
$url .= '/tests/resources/';

return
"http://" . $_SERVER['HTTP_HOST'] .
$path . "staticFileServer.php?" . FILE_MODE_REQUEST_VAR . "=" . STATIC_SERVER_MODE .
return $url . "staticFileServer.php?" . FILE_MODE_REQUEST_VAR . "=" . STATIC_SERVER_MODE .
"&" . SRV_MODE_REQUEST_VAR . "=";
}

Expand Down

0 comments on commit 5e3b044

Please sign in to comment.