mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 08:34:09 +02:00
adjust tests to new phpunit
This commit is contained in:
parent
eaf1768cd9
commit
a0abe86651
9 changed files with 97 additions and 23 deletions
|
|
@ -22,10 +22,8 @@ class CallbackWrapperTest extends WrapperTest {
|
|||
return \Icewind\Streams\CallbackWrapper::wrap($source, $read, $write, $close, $readDir, $preClose);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testWrapInvalidSource() {
|
||||
$this->expectException(\BadMethodCallException::class);
|
||||
$this->wrapSource('foo');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@
|
|||
|
||||
namespace Icewind\Streams\Tests;
|
||||
|
||||
class HashWrapperTest extends \PHPUnit_Framework_TestCase {
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class HashWrapperTest extends TestCase {
|
||||
const DATA = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -17,10 +17,8 @@ class NullWrapperTest extends WrapperTest {
|
|||
return \Icewind\Streams\NullWrapper::wrap($source);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testNoContext() {
|
||||
$this->expectException(\BadMethodCallException::class);
|
||||
stream_wrapper_register('null', '\Icewind\Streams\NullWrapper');
|
||||
$context = stream_context_create(array());
|
||||
try {
|
||||
|
|
@ -32,10 +30,8 @@ class NullWrapperTest extends WrapperTest {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testNoSource() {
|
||||
$this->expectException(\BadMethodCallException::class);
|
||||
stream_wrapper_register('null', '\Icewind\Streams\NullWrapper');
|
||||
$context = stream_context_create(array(
|
||||
'null' => array(
|
||||
|
|
@ -50,10 +46,8 @@ class NullWrapperTest extends WrapperTest {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testWrapInvalidSource() {
|
||||
$this->expectException(\BadMethodCallException::class);
|
||||
$this->wrapSource('foo');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
|
||||
namespace Icewind\Streams\Tests;
|
||||
|
||||
abstract class WrapperTest extends \PHPUnit_Framework_TestCase {
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class WrapperTest extends TestCase {
|
||||
/**
|
||||
* @param resource $source
|
||||
* @return resource
|
||||
|
|
@ -93,6 +95,7 @@ abstract class WrapperTest extends \PHPUnit_Framework_TestCase {
|
|||
if (!flock($wrapped, LOCK_EX)) {
|
||||
$this->fail('Unable to acquire lock');
|
||||
}
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
public function testStreamOptions() {
|
||||
|
|
@ -101,6 +104,7 @@ abstract class WrapperTest extends \PHPUnit_Framework_TestCase {
|
|||
stream_set_blocking($wrapped, 0);
|
||||
stream_set_timeout($wrapped, 1, 0);
|
||||
stream_set_write_buffer($wrapped, 0);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
public function testReadDir() {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,4 @@
|
|||
<testsuite name='Stream'>
|
||||
<directory suffix='.php'>./</directory>
|
||||
</testsuite>
|
||||
|
||||
<filter>
|
||||
<whitelist Stream="true">
|
||||
<directory suffix=".php">../src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue