mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Updated test
This commit is contained in:
parent
960ddd0eb8
commit
463fa660bc
1 changed files with 5 additions and 16 deletions
|
@ -1179,27 +1179,16 @@ class CakeResponseTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Although unlikely, file's may contain dots in their filenames.
|
* Although unlikely, a file may contain dots in its filename.
|
||||||
* This should be allowed, as long as the dots doesn't specify a path (../ or ..\)
|
* This should be allowed, as long as the dots doesn't specify a path (../ or ..\)
|
||||||
*
|
*
|
||||||
|
* @expectedException NotFoundException
|
||||||
|
* @execptedExceptionMessageRegExp #The requested file .+my/Some..cat.gif was not found or not readable#
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testFileWithDotsInFilename() {
|
public function testFileWithDotsInFilename() {
|
||||||
$ok = false;
|
$response = new CakeResponse();
|
||||||
$file = 'my/Some..cat.gif';
|
$response->file('my/Some..cat.gif');
|
||||||
|
|
||||||
try {
|
|
||||||
$response = new CakeResponse();
|
|
||||||
$response->file($file);
|
|
||||||
} catch (NotFoundException $e) {
|
|
||||||
if (Configure::read('debug') > 0) {
|
|
||||||
$ok = $e->getMessage() === sprintf('The requested file %s was not found or not readable', APP . $file);
|
|
||||||
} else {
|
|
||||||
$ok = $e->getMessage() === 'The requested file was not found';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->assertTrue($ok);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue