1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 17:09:40 +01:00
amp/test/Pipeline/ToArrayTest.php
2020-09-24 12:53:31 -05:00

22 lines
493 B
PHP

<?php
namespace Amp\Test\Pipeline;
use Amp\PHPUnit\AsyncTestCase;
use Amp\Pipeline;
class ToArrayTest extends AsyncTestCase
{
public function testNonEmpty()
{
$pipeline = Pipeline\fromIterable(["abc", "foo", "bar"], 5);
$this->assertSame(["abc", "foo", "bar"], yield Pipeline\toArray($pipeline));
}
public function testEmpty()
{
$pipeline = Pipeline\fromIterable([], 5);
$this->assertSame([], yield Pipeline\toArray($pipeline));
}
}