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

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

public testThatGroupByImplicitlyIndexesTheGroupsByTheirKey ( Pinq\ITraversable $traversable, array $data )
$traversable Pinq\ITraversable
$data array
    public function testThatGroupByImplicitlyIndexesTheGroupsByTheirKey(\Pinq\ITraversable $traversable, array $data)
    {
        $groups = $traversable->groupBy(function ($i) {
            return $i[0];
        })->asArray();
        $this->assertCount(4, $groups);
        $this->assertMatchesValues($groups['a'], ['andrew']);
        $this->assertMatchesValues($groups['s'], ['sandy', 'sandra']);
        $this->assertMatchesValues($groups['t'], ['tucker', 'tom']);
        $this->assertMatchesValues($groups['d'], ['daniel']);
    }