Skip to content

Commit 8d91785

Browse files
AdrianAdrian
Adrian
authored and
Adrian
committed
test for the fix
1 parent 273e169 commit 8d91785

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/Integration/IncludesTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,28 @@ public function it_can_handle_multiple_includes_at_once()
8282

8383
$this->assertEquals($expectedArray, $array);
8484
}
85+
86+
/**
87+
* @test
88+
*/
89+
public function it_knows_to_ignore_invalid_includes_param()
90+
{
91+
$array = $this->fractal
92+
->collection($this->testBooks, new TestTransformer())
93+
->parseIncludes(null)
94+
->toArray();
95+
96+
$expectedArray = ['data' => [
97+
['id' => 1, 'author' => 'Philip K Dick', ],
98+
['id' => 2, 'author' => 'George R. R. Satan', ],
99+
]];
100+
101+
$this->assertEquals($expectedArray, $array);
102+
103+
$array = $this->fractal
104+
->collection($this->testBooks, new TestTransformer())
105+
->parseIncludes([])
106+
->toArray();
107+
$this->assertEquals($expectedArray, $array);
108+
}
85109
}

0 commit comments

Comments
 (0)