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 path = /home/test
guest ok = yes guest ok = yes
writeable = yes writeable = yes
ea support = yes
inherit permissions = yes" | sudo tee -a /etc/samba/smb.conf inherit permissions = yes" | sudo tee -a /etc/samba/smb.conf
- sudo service smbd restart - sudo service smbd restart
- testparm -s - testparm -s

View file

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

View file

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