[Filesystem] Fix transient tests

This commit is contained in:
Nicolas Grekas 2016-03-10 15:31:39 +01:00
parent be867ae968
commit a6edd78116
3 changed files with 6 additions and 3 deletions

View File

@ -22,7 +22,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
public function prepare_workspace()
{
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000);
$this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
mkdir($this->workspace, 0777, true);
$this->workspace = realpath($this->workspace);
}

View File

@ -48,7 +48,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
{
$this->umask = umask(0);
$this->filesystem = new Filesystem();
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000);
$this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
mkdir($this->workspace, 0777, true);
$this->workspace = realpath($this->workspace);
}

View File

@ -414,7 +414,10 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
public function testFormatWithIntlTimeZone()
{
if (PHP_VERSION_ID < 50500 && !(extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) {
if (!extension_loaded('intl')) {
$this->markTestSkipped('Extension intl is required.');
}
if (PHP_VERSION_ID < 50500 && !method_exists('IntlDateFormatter', 'setTimeZone')) {
$this->markTestSkipped('Only in PHP 5.5+ IntlDateFormatter allows to use DateTimeZone objects.');
}