Skip to content

Commit a6edd78

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

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
2222

2323
public function prepare_workspace()
2424
{
25-
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000);
25+
$this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
2626
mkdir($this->workspace, 0777, true);
2727
$this->workspace = realpath($this->workspace);
2828
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function setUp()
4848
{
4949
$this->umask = umask(0);
5050
$this->filesystem = new Filesystem();
51-
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000);
51+
$this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
5252
mkdir($this->workspace, 0777, true);
5353
$this->workspace = realpath($this->workspace);
5454
}

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)