From ab973cab348104bfa6c0d2d72caeaa4ce6a3994d Mon Sep 17 00:00:00 2001 From: madflow Date: Wed, 18 Dec 2019 08:40:49 +0100 Subject: [PATCH] use existing base folder --- tests/Spout/Common/Helper/FileSystemHelperTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Spout/Common/Helper/FileSystemHelperTest.php b/tests/Spout/Common/Helper/FileSystemHelperTest.php index 7c7da03..f99ab30 100644 --- a/tests/Spout/Common/Helper/FileSystemHelperTest.php +++ b/tests/Spout/Common/Helper/FileSystemHelperTest.php @@ -18,7 +18,7 @@ class FileSystemHelperTest extends TestCase */ public function setUp() { - $baseFolder = '/tmp/base_folder'; + $baseFolder = \sys_get_temp_dir(); $this->fileSystemHelper = new FileSystemHelper($baseFolder); } @@ -28,7 +28,7 @@ class FileSystemHelperTest extends TestCase public function testCreateFolderShouldThrowExceptionIfOutsideOfBaseFolder() { $this->expectException(IOException::class); - + $this->expectExceptionMessage('Cannot perform I/O operation outside of the base folder'); $this->fileSystemHelper->createFolder('/tmp/folder_outside_base_folder', 'folder_name'); } @@ -38,7 +38,7 @@ class FileSystemHelperTest extends TestCase public function testCreateFileWithContentsShouldThrowExceptionIfOutsideOfBaseFolder() { $this->expectException(IOException::class); - + $this->expectExceptionMessage('Cannot perform I/O operation outside of the base folder'); $this->fileSystemHelper->createFileWithContents('/tmp/folder_outside_base_folder', 'file_name', 'contents'); } @@ -48,7 +48,7 @@ class FileSystemHelperTest extends TestCase public function testDeleteFileShouldThrowExceptionIfOutsideOfBaseFolder() { $this->expectException(IOException::class); - + $this->expectExceptionMessage('Cannot perform I/O operation outside of the base folder'); $this->fileSystemHelper->deleteFile('/tmp/folder_outside_base_folder/file_name'); } @@ -58,6 +58,7 @@ class FileSystemHelperTest extends TestCase public function testDeleteFolderRecursivelyShouldThrowExceptionIfOutsideOfBaseFolder() { $this->expectException(IOException::class); + $this->expectExceptionMessage('Cannot perform I/O operation outside of the base folder'); $this->fileSystemHelper->deleteFolderRecursively('/tmp/folder_outside_base_folder'); }