mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
Additional test case
This commit is contained in:
parent
156d25d7f5
commit
cd5261a86d
1 changed files with 32 additions and 0 deletions
|
|
@ -466,4 +466,36 @@ abstract class AbstractShare extends \PHPUnit_Framework_TestCase {
|
|||
$this->assertFalse($info->isSystem());
|
||||
$this->assertFalse($info->isHidden());
|
||||
}
|
||||
|
||||
public function pathProvider() {
|
||||
// / ? < > \ : * | " are illegal characters in path on windows
|
||||
return array(
|
||||
array('dir/sub/foo.txt'),
|
||||
array('bar.txt'),
|
||||
array("single'quote'/sub/foo.txt"),
|
||||
array('日本語/url %2F +encode/asd.txt'),
|
||||
array('a somewhat longer folder than the other with more charaters as the all the other filenames/' .
|
||||
'followed by a somewhat long file name after that.txt')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider pathProvider
|
||||
*/
|
||||
public function testSubDirs($path) {
|
||||
$dirs = explode('/', $path);
|
||||
$name = array_pop($dirs);
|
||||
$fullPath = '';
|
||||
foreach ($dirs as $dir) {
|
||||
$fullPath .= '/' . $dir;
|
||||
$this->share->mkdir($this->root . $fullPath);
|
||||
}
|
||||
$txtFile = $this->getTextFile();
|
||||
$size = filesize($txtFile);
|
||||
$this->share->put($txtFile, $this->root . $fullPath . '/' . $name);
|
||||
unlink($txtFile);
|
||||
$info = $this->share->stat($this->root . $fullPath . '/' . $name);
|
||||
$this->assertEquals($size, $info->getSize());
|
||||
$this->assertFalse($info->isHidden());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue