mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Add test for backticks in path and etag
This commit is contained in:
parent
bb5c5a3691
commit
f2f7f178a5
1 changed files with 22 additions and 0 deletions
22
tests/lib/files/cache/cache.php
vendored
22
tests/lib/files/cache/cache.php
vendored
|
|
@ -260,6 +260,28 @@ class Cache extends \Test\TestCase {
|
|||
$this->assertEquals(\OC\Files\Cache\Cache::COMPLETE, $this->cache->getStatus('foo'));
|
||||
}
|
||||
|
||||
public function putWithAllKindOfQuotesData() {
|
||||
return [
|
||||
['`backtick`'],
|
||||
['´forward´'],
|
||||
['\'single\''],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider putWithAllKindOfQuotesData
|
||||
* @param $fileName
|
||||
*/
|
||||
public function testPutWithAllKindOfQuotes($fileName) {
|
||||
|
||||
$this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->get($fileName));
|
||||
$this->cache->put($fileName, array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file', 'etag' => $fileName));
|
||||
|
||||
$cacheEntry = $this->cache->get($fileName);
|
||||
$this->assertEquals($fileName, $cacheEntry['etag']);
|
||||
$this->assertEquals($fileName, $cacheEntry['path']);
|
||||
}
|
||||
|
||||
function testSearch() {
|
||||
$file1 = 'folder';
|
||||
$file2 = 'folder/foobar';
|
||||
|
|
|
|||
Loading…
Reference in a new issue