Fix unit test

This commit is contained in:
Robin Appelman 2014-07-31 16:15:35 +02:00
commit 00f74274a3
3 changed files with 6 additions and 17 deletions

View file

@ -29,7 +29,6 @@ before_install:
path = /home/test
guest ok = yes
writeable = yes
ea support = yes
inherit permissions = yes" | sudo tee -a /etc/samba/smb.conf
- sudo service smbd restart
- testparm -s

View file

@ -114,18 +114,8 @@ class NativeShare implements IShare {
/**
* List the content of a remote folder
*
* Returns a nested array in the format of
* [
* $name => [
* 'size' => $size,
* 'type' => $type,
* 'time' => $mtime
* ],
* ...
* ]
*
* @param $path
* @return array[]
* @param string $path
* @return \Icewind\SMB\IFileInfo[]
*
* @throws \Icewind\SMB\NotFoundException
* @throws \Icewind\SMB\InvalidTypeException

View file

@ -93,11 +93,11 @@ class NativeStream extends \PHPUnit_Framework_TestCase {
public function cleanDir($dir) {
$content = $this->share->dir($dir);
foreach ($content as $name => $metadata) {
if ($metadata['type'] === 'dir') {
$this->cleanDir($dir . '/' . $name);
foreach ($content as $metadata) {
if ($metadata->isDirectory()) {
$this->cleanDir($metadata->getPath());
} else {
$this->share->del($dir . '/' . $name);
$this->share->del($metadata->getPath());
}
}
$this->share->rmdir($dir);