| @@ 121-131 (lines=11) @@ | ||
| 118 | * @covers \League\Fractal\TransformerAbstract::callIncludeMethod | |
| 119 | * @expectedException \BadMethodCallException | |
| 120 | */ | |
| 121 | public function testProcessEmbeddedResourcesInvalidDefaultEmbed() | |
| 122 |     { | |
| 123 |         $transformer = m::mock('League\Fractal\TransformerAbstract')->makePartial(); | |
| 124 | ||
| 125 | $manager = new Manager(); | |
| 126 | ||
| 127 |         $scope = new Scope($manager, m::mock('League\Fractal\Resource\ResourceAbstract')); | |
| 128 | ||
| 129 | $transformer->setDefaultIncludes(['book']); | |
| 130 | $transformer->processIncludedResources($scope, []); | |
| 131 | } | |
| 132 | ||
| 133 | /** | |
| 134 | * @covers \League\Fractal\TransformerAbstract::processIncludedResources | |
| @@ 228-240 (lines=13) @@ | ||
| 225 | /** | |
| 226 | * @expectedException \InvalidArgumentException | |
| 227 | */ | |
| 228 | public function testScopeRequiresConcreteImplementation() | |
| 229 |     { | |
| 230 | $manager = new Manager(); | |
| 231 |         $manager->parseIncludes('book'); | |
| 232 | ||
| 233 |         $resource = Mockery::mock('League\Fractal\Resource\ResourceAbstract', [ | |
| 234 | ['bar' => 'baz'], | |
| 235 |             function () {}, | |
| 236 | ])->makePartial(); | |
| 237 | ||
| 238 | $scope = new Scope($manager, $resource); | |
| 239 | $scope->toArray(); | |
| 240 | } | |
| 241 | ||
| 242 | public function testToArrayWithIncludes() | |
| 243 |     { | |