From 57225973e00a1333e4f4a702f40f2dd325b03656 Mon Sep 17 00:00:00 2001 From: mattab <matthieu.aubry@gmail.com> Date: Tue, 21 Oct 2014 17:38:55 +1300 Subject: [PATCH] Fix few integration tests --- tests/PHPUnit/Integration/HttpTest.php | 2 +- tests/PHPUnit/Integration/ReleaseCheckListTest.php | 2 +- tests/PHPUnit/Integration/ServeStaticFileTest.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/PHPUnit/Integration/HttpTest.php b/tests/PHPUnit/Integration/HttpTest.php index 4b54785f66..68988d78a9 100644 --- a/tests/PHPUnit/Integration/HttpTest.php +++ b/tests/PHPUnit/Integration/HttpTest.php @@ -83,7 +83,7 @@ class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase $this->assertEquals(206, $result['status']); $this->assertTrue(isset($result['headers']['Content-Range'])); $this->assertEquals('bytes 10-20/', substr($result['headers']['Content-Range'], 0, 12)); - $this->assertEquals('application/x-javascript', $result['headers']['Content-Type']); + $this->assertTrue( in_array($result['headers']['Content-Type'], array('application/x-javascript', 'application/javascript'))); } } diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php index b1a96a91cf..9fefc14f11 100644 --- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php @@ -366,9 +366,9 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase { $isIniFileInTests = strpos($file, "/tests/") !== false; $isTestResultFile = strpos($file, "/System/expected") !== false - || strpos($file, "/System/processed") !== false || strpos($file, "tests/resources/Updater/") !== false || strpos($file, "Twig/Tests/") !== false + || strpos($file, "processed/") !== false || strpos($file, "/vendor/") !== false; $isLib = strpos($file, "lib/xhprof") !== false || strpos($file, "phpunit/phpunit") !== false; diff --git a/tests/PHPUnit/Integration/ServeStaticFileTest.php b/tests/PHPUnit/Integration/ServeStaticFileTest.php index bdf288efd4..236bc748c3 100644 --- a/tests/PHPUnit/Integration/ServeStaticFileTest.php +++ b/tests/PHPUnit/Integration/ServeStaticFileTest.php @@ -51,7 +51,9 @@ class Test_Piwik_ServeStaticFile extends PHPUnit_Framework_TestCase public function tearDown() { parent::tearDown(); - chmod(TEST_FILE_LOCATION, 0644); + if(!chmod(TEST_FILE_LOCATION, 0644)) { + throw new Exception("Could not chmod 0644 " . TEST_FILE_LOCATION); + } } /** -- GitLab