mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
Extend nativestream tests
This commit is contained in:
parent
dd983282a6
commit
0cf2fa0904
2 changed files with 30 additions and 2 deletions
|
|
@ -79,6 +79,15 @@ class NativeStream extends \PHPUnit_Framework_TestCase {
|
|||
unlink($tmpFile1);
|
||||
}
|
||||
|
||||
public function testStat() {
|
||||
$sourceFile = $this->getTextFile();
|
||||
$this->share->put($sourceFile, $this->root . '/foobar');
|
||||
$fh = $this->share->read($this->root . '/foobar');
|
||||
$stat = fstat($fh);
|
||||
$this->assertEquals(filesize($sourceFile), $stat['size']);
|
||||
unlink($sourceFile);
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
if ($this->share) {
|
||||
$this->cleanDir($this->root);
|
||||
|
|
@ -97,4 +106,23 @@ class NativeStream extends \PHPUnit_Framework_TestCase {
|
|||
}
|
||||
$this->share->rmdir($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Icewind\SMB\Exception
|
||||
*/
|
||||
public function testNoContext() {
|
||||
return fopen('nativesmb://dummy', 'r');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Icewind\SMB\Exception
|
||||
*/
|
||||
public function testInvalidContext() {
|
||||
$context = stream_context_create(array(
|
||||
'nativesmb' => array(
|
||||
'foo' => 'bar'
|
||||
)
|
||||
));
|
||||
return fopen('nativesmb://dummy', 'r', false, $context);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue