mirror of
https://github.com/danog/amp.git
synced 2024-12-12 09:29:45 +01:00
22 lines
473 B
PHP
22 lines
473 B
PHP
<?php
|
|
|
|
namespace Amp\Test\Stream;
|
|
|
|
use Amp\PHPUnit\AsyncTestCase;
|
|
use Amp\Stream;
|
|
|
|
class ToArrayTest extends AsyncTestCase
|
|
{
|
|
public function testNonEmpty()
|
|
{
|
|
$stream = Stream\fromIterable(["abc", "foo", "bar"], 5);
|
|
$this->assertSame(["abc", "foo", "bar"], yield Stream\toArray($stream));
|
|
}
|
|
|
|
public function testEmpty()
|
|
{
|
|
$stream = Stream\fromIterable([], 5);
|
|
$this->assertSame([], yield Stream\toArray($stream));
|
|
}
|
|
}
|