update tests to new phpunit

This commit is contained in:
Robin Appelman 2021-03-02 17:34:36 +01:00
commit 58f6df3807
11 changed files with 59 additions and 101 deletions

View file

@ -8,13 +8,15 @@
namespace Icewind\SMB\Test;
use Icewind\SMB\BasicAuth;
use Icewind\SMB\Exception\ConnectException;
use Icewind\SMB\Exception\DependencyException;
use Icewind\SMB\Options;
use Icewind\SMB\System;
use Icewind\SMB\TimeZoneProvider;
use Icewind\SMB\Wrapped\Server as NormalServer;
class ShareTest extends AbstractShareTest {
public function setUp() {
public function setUp(): void {
$this->requireBackendEnv('smbclient');
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
$this->server = new NormalServer(
@ -37,17 +39,13 @@ class ShareTest extends AbstractShareTest {
$this->share->mkdir($this->root);
}
/**
* @expectedException \Icewind\SMB\Exception\DependencyException
*/
public function testAppendStream() {
$this->expectException(DependencyException::class);
$this->share->append($this->root . '/foo');
}
/**
* @expectedException \Icewind\SMB\Exception\ConnectException
*/
public function testHostEscape() {
$this->expectException(ConnectException::class);
$this->requireBackendEnv('smbclient');
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
$this->server = new NormalServer(