From 885c2684cffbfe6cb7f7a799f9bda37acef9979c Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 28 May 2018 18:35:35 +0200 Subject: [PATCH] Create random directories within our own temporary test directory --- tests/TestCase.php | 2 +- travis-init.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 748a608a..22252347 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -59,7 +59,7 @@ protected function mockAdapter(LoopInterface $loop = null) public function setUp() { - $this->tmpDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('react-filesystem-tests-') . DIRECTORY_SEPARATOR; + $this->tmpDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'react-filesystem-tests' . DIRECTORY_SEPARATOR . uniqid('', true) . DIRECTORY_SEPARATOR; mkdir($this->tmpDir, 0777, true); $this->startTime = time(); } diff --git a/travis-init.sh b/travis-init.sh index 1d338e48..485ebd98 100755 --- a/travis-init.sh +++ b/travis-init.sh @@ -1,5 +1,8 @@ #!/bin/bash +mkdir `php -r "echo sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'react-filesystem-tests' . DIRECTORY_SEPARATOR;"` +chmod 0777 -Rfv `php -r "echo sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'react-filesystem-tests' . DIRECTORY_SEPARATOR;"` + if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then # install 'eio' PHP extension (does not support nightly) if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then