mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Use PSR4 to autoload tests
This commit is contained in:
parent
e74a83a400
commit
3697e04c63
5 changed files with 14 additions and 11 deletions
|
|
@ -18,7 +18,8 @@
|
||||||
},
|
},
|
||||||
"autoload" : {
|
"autoload" : {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Icewind\\SMB\\": "src/"
|
"Icewind\\SMB\\": "src/",
|
||||||
|
"Icewind\\SMB\\Test\\": "tests/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SMB\Test;
|
namespace Icewind\SMB\Test;
|
||||||
|
|
||||||
require_once 'share.php';
|
|
||||||
|
|
||||||
class NativeShare extends Share {
|
class NativeShare extends Share {
|
||||||
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SMB\Test;
|
namespace Icewind\SMB\Test;
|
||||||
|
|
||||||
|
use Icewind\SMB\NativeServer;
|
||||||
|
|
||||||
class NativeStream extends \PHPUnit_Framework_TestCase {
|
class NativeStream extends \PHPUnit_Framework_TestCase {
|
||||||
/**
|
/**
|
||||||
|
|
@ -25,8 +27,8 @@ class NativeStream extends \PHPUnit_Framework_TestCase {
|
||||||
$this->markTestSkipped('libsmbclient php extension not installed');
|
$this->markTestSkipped('libsmbclient php extension not installed');
|
||||||
}
|
}
|
||||||
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
||||||
$this->server = new \Icewind\SMB\NativeServer($this->config->host, $this->config->user, $this->config->password);
|
$this->server = new NativeServer($this->config->host, $this->config->user, $this->config->password);
|
||||||
$this->share = new \Icewind\SMB\NativeShare($this->server, $this->config->share);
|
$this->share = $this->server->getShare($this->config->share);
|
||||||
if ($this->config->root) {
|
if ($this->config->root) {
|
||||||
$this->root = '/' . $this->config->root . '/' . uniqid();
|
$this->root = '/' . $this->config->root . '/' . uniqid();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SMB\Test;
|
namespace Icewind\SMB\Test;
|
||||||
|
|
||||||
class Server extends \PHPUnit_Framework_TestCase {
|
class Server extends \PHPUnit_Framework_TestCase {
|
||||||
/**
|
/**
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace SMB\Test;
|
namespace Icewind\SMB\Test;
|
||||||
|
|
||||||
|
use Icewind\SMB\Server;
|
||||||
|
|
||||||
class Share extends \PHPUnit_Framework_TestCase {
|
class Share extends \PHPUnit_Framework_TestCase {
|
||||||
/**
|
/**
|
||||||
|
|
@ -22,8 +24,8 @@ class Share extends \PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
$this->config = json_decode(file_get_contents(__DIR__ . '/config.json'));
|
||||||
$this->server = new \Icewind\SMB\Server($this->config->host, $this->config->user, $this->config->password);
|
$this->server = new Server($this->config->host, $this->config->user, $this->config->password);
|
||||||
$this->share = new \Icewind\SMB\Share($this->server, $this->config->share);
|
$this->share = $this->server->getShare($this->config->share);
|
||||||
if ($this->config->root) {
|
if ($this->config->root) {
|
||||||
$this->root = '/' . $this->config->root . '/' . uniqid();
|
$this->root = '/' . $this->config->root . '/' . uniqid();
|
||||||
} else {
|
} else {
|
||||||
Loading…
Add table
Add a link
Reference in a new issue