mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
fix risky tests
This commit is contained in:
parent
8481d66c8d
commit
507b186800
2 changed files with 14 additions and 14 deletions
|
|
@ -12,6 +12,7 @@ use Icewind\SMB\Exception\InvalidPathException;
|
||||||
use Icewind\SMB\Exception\NotFoundException;
|
use Icewind\SMB\Exception\NotFoundException;
|
||||||
use Icewind\SMB\FileInfo;
|
use Icewind\SMB\FileInfo;
|
||||||
use Icewind\SMB\IFileInfo;
|
use Icewind\SMB\IFileInfo;
|
||||||
|
use Icewind\SMB\IShare;
|
||||||
|
|
||||||
abstract class AbstractShareTest extends TestCase {
|
abstract class AbstractShareTest extends TestCase {
|
||||||
/**
|
/**
|
||||||
|
|
@ -117,12 +118,11 @@ abstract class AbstractShareTest extends TestCase {
|
||||||
|
|
||||||
public function testListShares() {
|
public function testListShares() {
|
||||||
$shares = $this->server->listShares();
|
$shares = $this->server->listShares();
|
||||||
foreach ($shares as $share) {
|
$names = array_map(function (IShare $share) {
|
||||||
if ($share->getName() === $this->config->share) {
|
return $share->getName();
|
||||||
return;
|
}, $shares);
|
||||||
}
|
|
||||||
}
|
$this->assertContains($this->config->share, $names);
|
||||||
$this->fail('Share "' . $this->config->share . '" not found');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRootStartsEmpty() {
|
public function testRootStartsEmpty() {
|
||||||
|
|
@ -664,7 +664,7 @@ abstract class AbstractShareTest extends TestCase {
|
||||||
unlink($txtFile);
|
unlink($txtFile);
|
||||||
|
|
||||||
$this->share->stat($this->root . '/' . $name);
|
$this->share->stat($this->root . '/' . $name);
|
||||||
$this->share->del($this->root . '/foo.txt');
|
$this->assertTrue($this->share->del($this->root . '/foo.txt'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
namespace Icewind\SMB\Test;
|
namespace Icewind\SMB\Test;
|
||||||
|
|
||||||
use Icewind\SMB\BasicAuth;
|
use Icewind\SMB\BasicAuth;
|
||||||
|
use Icewind\SMB\IShare;
|
||||||
use Icewind\SMB\Options;
|
use Icewind\SMB\Options;
|
||||||
use Icewind\SMB\System;
|
use Icewind\SMB\System;
|
||||||
use Icewind\SMB\TimeZoneProvider;
|
use Icewind\SMB\TimeZoneProvider;
|
||||||
|
|
@ -39,12 +40,11 @@ class ServerTest extends TestCase {
|
||||||
|
|
||||||
public function testListShares() {
|
public function testListShares() {
|
||||||
$shares = $this->server->listShares();
|
$shares = $this->server->listShares();
|
||||||
foreach ($shares as $share) {
|
$names = array_map(function (IShare $share) {
|
||||||
if ($share->getName() === $this->config->share) {
|
return $share->getName();
|
||||||
return;
|
}, $shares);
|
||||||
}
|
|
||||||
}
|
$this->assertContains($this->config->share, $names);
|
||||||
$this->fail('Share "' . $this->config->share . '" not found');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue