mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +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
|
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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue