mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
Fix unit test
This commit is contained in:
parent
248d308605
commit
00f74274a3
3 changed files with 6 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue