Skip to content

Commit

Permalink
Merge branch '2.1'
Browse files Browse the repository at this point in the history
* 2.1:
  Added Base64 encoding, decoding to MongoDBProfilerStorage
  Fix duplicated code and a field name
  refactor src/Symfony/Component/Translation/Loader/MoFileLoader.php
  fixed typo
  Update src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
  fixed issue #5596 (Broken DOM with the profiler's toolbar set in position top)
  [Form] Fixed the testsuite for PHPUnit 3.6 as travis still uses it
  added dirs generated by build-data.php in locale component to .gitignore
  [Process] Fixed bug introduced by 7bafc69.
  [Process][Tests] Prove process fail (Add more test case)
  [Process][Tests] Prove process fail
  [HttpFoundation] Fixed the tests
  [DomCrawler] Added test for supported encodings by mbstring
  [Config] Fixed preserving keys in associative arrays
  [Console] Fixed return value for Command::run
  [Locale] Fixed tests
  [Console] Fix some input tests
  [Filesystem] Fixed tests on Windows
  [Config] Fixed tests on Windows
  • Loading branch information
fabpot committed Sep 28, 2012
2 parents bf5f02a + 370f2ab commit 1721034
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Tests/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
*/
private $filesystem = null;

private static $symlinkOnWindows = null;

public static function setUpBeforeClass()
{
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
self::$symlinkOnWindows = true;
$originDir = tempnam(sys_get_temp_dir(), 'sl');
$targetDir = tempnam(sys_get_temp_dir(), 'sl');
if (true !== @symlink($originDir, $targetDir)) {
$report = error_get_last();
if (is_array($report) && false !== strpos($report['message'], 'error code(1314)')) {
self::$symlinkOnWindows = false;
}
}
}
}

public function setUp()
{
$this->filesystem = new Filesystem();
Expand Down Expand Up @@ -863,6 +880,10 @@ private function markAsSkippedIfSymlinkIsMissing()
if (!function_exists('symlink')) {
$this->markTestSkipped('symlink is not supported');
}

if (defined('PHP_WINDOWS_VERSION_MAJOR') && false === self::$symlinkOnWindows) {
$this->markTestSkipped('symlink requires "Create symbolic links" privilege on windows');
}
}

private function markAsSkippedIfChmodIsMissing()
Expand Down

0 comments on commit 1721034

Please sign in to comment.