Skip to content
Snippets Groups Projects
Commit c20d4d1a authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Add unit tests

parent f74525c3
Branches
No related tags found
No related merge requests found
......@@ -189,4 +189,32 @@ class Scanner extends \Test\TestCase {
$newInfo = $cache->get('');
$this->assertNotEquals($oldInfo['etag'], $newInfo['etag']);
}
/**
* @return array
*/
public function invalidPathProvider() {
return [
[
'../',
],
[
'..\\',
],
[
'../..\\../',
],
];
}
/**
* @dataProvider invalidPathProvider
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Invalid path to scan
* @param string $invalidPath
*/
public function testInvalidPathScanning($invalidPath) {
$scanner = new TestScanner('', \OC::$server->getDatabaseConnection());
$scanner->scan($invalidPath);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment