mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
split test cases
This commit is contained in:
parent
78916cfc08
commit
c94eea8294
4 changed files with 59 additions and 15 deletions
35
tests/server.php
Normal file
35
tests/server.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace SMB\Test;
|
||||
|
||||
class Server extends \PHPUnit_Framework_TestCase {
|
||||
/**
|
||||
* @var \SMB\Server $server
|
||||
*/
|
||||
private $server;
|
||||
|
||||
private $config;
|
||||
|
||||
public function setUp() {
|
||||
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
||||
$this->server = new \SMB\Server($this->config->host, $this->config->user, $this->config->password);
|
||||
}
|
||||
|
||||
public function testListShares() {
|
||||
$shares = $this->server->listShares();
|
||||
foreach ($shares as $share) {
|
||||
if ($share->getName() === $this->config->share) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
$this->fail('Share "' . $this->config->share . '" not found');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \SMB\AuthenticationException
|
||||
*/
|
||||
public function testWrongUserName() {
|
||||
$server = new \SMB\Server($this->config->host, uniqid(), $this->config->password);
|
||||
$server->listShares();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue