Switch to phpunit 8

This commit is contained in:
Pierre Rudloff 2019-11-30 14:08:18 +01:00
parent 54f41d9396
commit fea1cce2d4
21 changed files with 330 additions and 335 deletions

View file

@ -23,7 +23,7 @@ abstract class StreamTest extends BaseTest
*
* @return void
*/
protected function tearDown()
protected function tearDown(): void
{
$this->stream->close();
}
@ -50,7 +50,7 @@ abstract class StreamTest extends BaseTest
*/
public function testTell()
{
$this->assertInternalType('int', $this->stream->tell());
$this->assertIsInt($this->stream->tell());
}
/**
@ -82,7 +82,7 @@ abstract class StreamTest extends BaseTest
public function testRead()
{
$result = $this->stream->read(8192);
$this->assertInternalType('string', $result);
$this->assertIsString($result);
$this->assertLessThanOrEqual(8192, strlen($result));
}
@ -123,7 +123,7 @@ abstract class StreamTest extends BaseTest
*/
public function testIsSeekable()
{
$this->assertInternalType('boolean', $this->stream->isSeekable());
$this->assertIsBool($this->stream->isSeekable());
}
/**
@ -154,7 +154,7 @@ abstract class StreamTest extends BaseTest
*/
public function testIsWritable()
{
$this->assertInternalType('boolean', $this->stream->isWritable());
$this->assertIsBool($this->stream->isWritable());
}
/**
@ -174,7 +174,7 @@ abstract class StreamTest extends BaseTest
*/
public function testGetContents()
{
$this->assertInternalType('string', $this->stream->getContents());
$this->assertIsString($this->stream->getContents());
}
/**
@ -184,7 +184,7 @@ abstract class StreamTest extends BaseTest
*/
public function testGetMetadata()
{
$this->assertInternalType('array', $this->stream->getMetadata());
$this->assertIsArray($this->stream->getMetadata());
}
/**
@ -194,9 +194,9 @@ abstract class StreamTest extends BaseTest
*/
public function testGetMetadataWithKey()
{
$this->assertInternalType('string', $this->stream->getMetadata('stream_type'));
$this->assertInternalType('string', $this->stream->getMetadata('mode'));
$this->assertInternalType('boolean', $this->stream->getMetadata('seekable'));
$this->assertIsString($this->stream->getMetadata('stream_type'));
$this->assertIsString($this->stream->getMetadata('mode'));
$this->assertIsBool($this->stream->getMetadata('seekable'));
$this->assertNull($this->stream->getMetadata('foo'));
}
@ -207,7 +207,7 @@ abstract class StreamTest extends BaseTest
*/
public function testDetach()
{
$this->assertInternalType('resource', $this->stream->detach());
$this->assertIsResource($this->stream->detach());
}
/**
@ -217,7 +217,7 @@ abstract class StreamTest extends BaseTest
*/
public function testToString()
{
$this->assertInternalType('string', $this->stream->__toString());
$this->assertInternalType('string', (string) $this->stream);
$this->assertIsString($this->stream->__toString());
$this->assertIsString((string) $this->stream);
}
}