1
0
mirror of https://github.com/danog/amp.git synced 2024-12-03 18:07:57 +01:00
amp/test/Pipeline/ToArrayTest.php
2020-10-02 13:40:29 -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(): void
{
$pipeline = Pipeline\fromIterable(["abc", "foo", "bar"], 5);
$this->assertSame(["abc", "foo", "bar"], Pipeline\toArray($pipeline));
}
public function testEmpty(): void
{
$pipeline = Pipeline\fromIterable([], 5);
$this->assertSame([], Pipeline\toArray($pipeline));
}
}