diff --git a/test/Compress/ZipTest.php b/test/Compress/ZipTest.php index 0a399ff4..265a8558 100644 --- a/test/Compress/ZipTest.php +++ b/test/Compress/ZipTest.php @@ -22,7 +22,7 @@ public function setUp() $this->markTestSkipped('This adapter needs the zip extension'); } - $this->tmp = sys_get_temp_dir() . '/' . str_replace('\\', '_', __CLASS__); + $this->tmp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . str_replace('\\', '_', __CLASS__); $files = array( $this->tmp . '/compressed.zip', diff --git a/test/File/RenameTest.php b/test/File/RenameTest.php index c8ede317..a947a9c2 100644 --- a/test/File/RenameTest.php +++ b/test/File/RenameTest.php @@ -491,7 +491,7 @@ public function testGetRandomizedFile() $filter->getFile() ); $fileNoExt = $this->_filesPath . 'newfile'; - $this->assertRegExp('#' . $fileNoExt . '_.{13}\.xml#', $filter->getNewName($this->_oldFile)); + $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}\.xml#', $filter->getNewName($this->_oldFile)); } /** @@ -515,7 +515,7 @@ public function testGetRandomizedFileWithoutExtension() )), $filter->getFile() ); - $this->assertRegExp('#' . $fileNoExt . '_.{13}#', $filter->getNewName($this->_oldFile)); + $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}#', $filter->getNewName($this->_oldFile)); } /** diff --git a/test/File/RenameUploadTest.php b/test/File/RenameUploadTest.php index eb0d2cdc..75bc106b 100644 --- a/test/File/RenameUploadTest.php +++ b/test/File/RenameUploadTest.php @@ -66,9 +66,9 @@ public function setUp() mkdir($this->_filesPath); mkdir($this->_newDir); - $this->_oldFile = $this->_filesPath . '/testfile.txt'; - $this->_newFile = $this->_filesPath . '/newfile.xml'; - $this->_newDirFile = $this->_newDir . '/testfile.txt'; + $this->_oldFile = $this->_filesPath . DIRECTORY_SEPARATOR . 'testfile.txt'; + $this->_newFile = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile.xml'; + $this->_newDirFile = $this->_newDir . DIRECTORY_SEPARATOR . 'testfile.txt'; touch($this->_oldFile); } @@ -245,18 +245,18 @@ public function testCannotOverwriteExistingFile() */ public function testGetRandomizedFile() { - $fileNoExt = $this->_filesPath . '/newfile'; + $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile'; $filter = new RenameUploadMock(array( 'target' => $this->_newFile, 'randomize' => true, )); - $this->assertRegExp('#' . $fileNoExt . '_.{13}\.xml#', $filter($this->_oldFile)); + $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}\.xml#', $filter($this->_oldFile)); } public function testGetFileWithOriginalExtension() { - $fileNoExt = $this->_filesPath . '/newfile'; + $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile'; $filter = new RenameUploadMock(array( 'target' => $this->_newFile, 'use_upload_extension' => true, @@ -266,14 +266,14 @@ public function testGetFileWithOriginalExtension() $oldFilePathInfo = pathinfo($this->_oldFile); $this->assertRegExp( - '#' . $fileNoExt . '.'.$oldFilePathInfo['extension'].'#', + '#' . str_replace('\\', '\\\\', $fileNoExt) . '.'.$oldFilePathInfo['extension'].'#', $filter($this->_oldFile) ); } public function testGetRandomizedFileWithOriginalExtension() { - $fileNoExt = $this->_filesPath . '/newfile'; + $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile'; $filter = new RenameUploadMock(array( 'target' => $this->_newFile, 'use_upload_extension' => true, @@ -283,7 +283,7 @@ public function testGetRandomizedFileWithOriginalExtension() $oldFilePathInfo = pathinfo($this->_oldFile); $this->assertRegExp( - '#' . $fileNoExt . '_.{13}\.'.$oldFilePathInfo['extension'].'#', + '#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}\.'.$oldFilePathInfo['extension'].'#', $filter($this->_oldFile) ); } @@ -293,13 +293,13 @@ public function testGetRandomizedFileWithOriginalExtension() */ public function testGetRandomizedFileWithoutExtension() { - $fileNoExt = $this->_filesPath . '/newfile'; + $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile'; $filter = new RenameUploadMock(array( 'target' => $fileNoExt, 'randomize' => true, )); - $this->assertRegExp('#' . $fileNoExt . '_.{13}#', $filter($this->_oldFile)); + $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}#', $filter($this->_oldFile)); } /**