Check that PlaylistArchiveStream::stream_read returns a string
This commit is contained in:
parent
d35b43dc17
commit
47789f8f8d
5 changed files with 330 additions and 14 deletions
|
@ -95,7 +95,11 @@ class PlaylistArchiveStreamTest extends TestCase
|
|||
{
|
||||
$this->stream->stream_open('playlist://BaW_jenozKc;BaW_jenozKc/worst');
|
||||
while (!$this->stream->stream_eof()) {
|
||||
$this->assertLessThanOrEqual(8192, strlen($this->stream->stream_read(8192)));
|
||||
$result = $this->stream->stream_read(8192);
|
||||
$this->assertInternalType('string', $result);
|
||||
if (is_string($result)) {
|
||||
$this->assertLessThanOrEqual(8192, strlen($result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* File used to bootstrap tests.
|
||||
*/
|
||||
use Alltube\PlaylistArchiveStream;
|
||||
use phpmock\mockery\PHPMockery;
|
||||
|
||||
/**
|
||||
* Composer autoload.
|
||||
|
@ -14,3 +15,9 @@ session_cache_limiter('');
|
|||
session_start();
|
||||
|
||||
stream_wrapper_register('playlist', PlaylistArchiveStream::class);
|
||||
|
||||
/**
|
||||
* @see https://bugs.php.net/bug.php?id=68541
|
||||
*/
|
||||
PHPMockery::define('Alltube', 'popen');
|
||||
PHPMockery::define('Alltube', 'fopen');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue