Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test/Compress/ZipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions test/File/RenameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand All @@ -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));
}

/**
Expand Down
22 changes: 11 additions & 11 deletions test/File/RenameUploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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)
);
}
Expand All @@ -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));
}

/**
Expand Down

0 comments on commit 2025c24

Please sign in to comment.