diff --git a/tests/Gitonomy/Git/Tests/AbstractTest.php b/tests/Gitonomy/Git/Tests/AbstractTest.php index 7bdab17..d6c1d08 100644 --- a/tests/Gitonomy/Git/Tests/AbstractTest.php +++ b/tests/Gitonomy/Git/Tests/AbstractTest.php @@ -109,6 +109,7 @@ public static function deleteDir($dir) $iterator = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS); $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $file) { + chmod($file, 0777); if (is_dir($file)) { rmdir($file); } else { @@ -116,6 +117,7 @@ public static function deleteDir($dir) } } + chmod($dir, 0777); rmdir($dir); } diff --git a/tests/Gitonomy/Git/Tests/HooksTest.php b/tests/Gitonomy/Git/Tests/HooksTest.php index bcc8888..1f3ff5f 100644 --- a/tests/Gitonomy/Git/Tests/HooksTest.php +++ b/tests/Gitonomy/Git/Tests/HooksTest.php @@ -131,7 +131,7 @@ public function testSet($repository) $this->assertEquals('bar', file_get_contents($file), 'Hook content is correct'); $perms = fileperms($file); - $this->assertEquals(0777, $perms & 0777, "Hook permissions are correct"); + $this->assertEquals(defined('PHP_WINDOWS_VERSION_BUILD') ? 0666 : 0777, $perms & 0777, "Hook permissions are correct"); } /** diff --git a/tests/Gitonomy/Git/Tests/RepositoryTest.php b/tests/Gitonomy/Git/Tests/RepositoryTest.php index fd1a819..8b6b827 100644 --- a/tests/Gitonomy/Git/Tests/RepositoryTest.php +++ b/tests/Gitonomy/Git/Tests/RepositoryTest.php @@ -34,7 +34,7 @@ public function testGetBlob_WithExisting_Works($repository) public function testGetSize($repository) { $size = $repository->getSize(); - $this->assertGreaterThan(100, $size, "Repository is greater than 100KB"); + $this->assertGreaterThan(70, $size, "Repository is greater than 70KB"); } public function testIsBare() diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f6dab15..74243c8 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,11 +2,11 @@ require __DIR__.'/../vendor/autoload.php'; if (defined('PHP_WINDOWS_VERSION_BUILD')) { - $server = array_change_key_case($_SERVER); + $server = array_change_key_case($_SERVER, true); $_SERVER['GIT_ENVS'] = array(); foreach (array('PATH', 'SYSTEMROOT') as $key) { - if (isset($server[strtolower($key)])) { - $_SERVER['GIT_ENVS'][strtoupper($key)] = $server[strtolower($key)]; + if (isset($server[$key])) { + $_SERVER['GIT_ENVS'][$key] = $server[$key]; } } unset($server);