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

@ -22,6 +22,7 @@
namespace Icewind\SMB\Test;
use Icewind\SMB\AnonymousAuth;
use Icewind\SMB\Exception\DependencyException;
use Icewind\SMB\IAuth;
use Icewind\SMB\Native\NativeServer;
use Icewind\SMB\ServerFactory;
@ -32,7 +33,7 @@ class ServerFactoryTest extends TestCase {
/** @var IAuth */
private $credentials;
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->credentials = new AnonymousAuth();
@ -59,10 +60,8 @@ class ServerFactoryTest extends TestCase {
$this->assertInstanceOf(NativeServer::class, $factory->createServer('localhost', $this->credentials));
}
/**
* @expectedException \Icewind\SMB\Exception\DependencyException
*/
public function testNoBackend() {
$this->expectException(DependencyException::class);
$this->requireBackendEnv('smbclient');
$system = $this->getMockBuilder(System::class)
->setMethods(['libSmbclientAvailable', 'getSmbclientPath'])