Skip to content

Commit

Permalink
Groupby test now tests recombine as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
sqonk committed Jan 20, 2021
1 parent 8e001bc commit f3583ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/DataFrameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,13 @@ public function testCumulativeMin()

public function testGroupby()
{
$df = dataframe([
$original = [
['name' => 'Falcon', 'Animal' => 'bird', 'Age' => 8, 'size' => 'big'],
['name' => 'Pigeon', 'Animal' => 'bird', 'Age' => 4, 'size' => 'small'],
['name' => 'Goat', 'Animal' => 'mammal', 'Age' => 12, 'size' => 'small'],
['name' => 'Possum', 'Animal' => 'mammal', 'Age' => 2, 'size' => 'big']
]);
];
$df = dataframe($original);
$g = $df->groupby('Animal');

$exp = [
Expand All @@ -681,6 +682,8 @@ public function testGroupby()
];

$this->assertSame($exp, array_values($g->data()));

$this->assertSame($original, $g->combine()->data());
}

public function testTranspose()
Expand Down

0 comments on commit f3583ab

Please sign in to comment.