8000 minor #18099 [Filesystem] Fix transient tests (nicolas-grekas) · symfony/symfony@6a99db4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a99db4

Browse files
minor #18099 [Filesystem] Fix transient tests (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [Filesystem] Fix transient tests | Q | A | ------------- | --- | Branch | 2.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - time().mt_rand(0, 1000) is not enough... also adds a missing skip Commits ------- a6edd78 [Filesystem] Fix transient tests
2 parents be867ae + a6edd78 commit 6a99db4

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)
0