Skip to content

Commit 3a79320

Browse files
[Filesystem] Fix transient tests
1 parent be867ae commit 3a79320

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
3131
*/
3232
private $filesystem = null;
3333

34+
private static $workspaceIndex = 0;
3435
private static $symlinkOnWindows = null;
3536

3637
public static function setUpBeforeClass()
@@ -48,7 +49,7 @@ protected function setUp()
4849
{
4950
$this->umask = umask(0);
5051
$this->filesystem = new Filesystem();
51-
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000);
52+
$this->workspace = sys_get_temp_dir().'/'.++self::$workspaceIndex.'.'.microtime(true);
5253
mkdir($this->workspace, 0777, true);
5354
$this->workspace = realpath($this->workspace);
5455
}

src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,10 @@ public function testFormatWithDateTimeZoneGmtOffset()
414414

415415
public function testFormatWithIntlTimeZone()
416416
{
417-
if (PHP_VERSION_ID < 50500 && !(extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) {
417+
if (!extension_loaded('intl')) {
418+
$this->markTestSkipped('Extension intl is required.');
419+
}
420+
if (PHP_VERSION_ID < 50500 && !method_exists('IntlDateFormatter', 'setTimeZone')) {
418421
$this->markTestSkipped('Only in PHP 5.5+ IntlDateFormatter allows to use DateTimeZone objects.');
419422
}
420423

0 commit comments

Comments
 (0)