1
0
mirror of https://github.com/danog/amp.git synced 2024-12-12 09:29:45 +01:00
amp/test/Pipeline/ToArrayTest.php

22 lines
493 B
PHP
Raw Normal View History

2020-08-23 16:18:28 +02:00
<?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));
}
}