Pinq\Tests\Integration\Traversable\GroupByTest::testThatGroupByMaintainsReferences PHP Метод

testThatGroupByMaintainsReferences() публичный Метод

public testThatGroupByMaintainsReferences ( Pinq\ITraversable $traversable, array $data )
$traversable Pinq\ITraversable
$data array
    public function testThatGroupByMaintainsReferences(\Pinq\ITraversable $traversable, array $data)
    {
        $data = $this->makeRefs(range(1, 10));
        $traversable = $traversable->append($data)->groupBy(function ($i) {
            return $i % 2 === 0;
        })[true]->iterate(function (&$i) {
            $i *= 10;
        });
        $this->assertSame($data, [1, 20, 3, 40, 5, 60, 7, 80, 9, 100]);
    }