public function testMissingParamFetchers() { $data = new CollectionRepresentation([new OffsetTestClass()]); $this->paramFetcher->method('get')->willThrowException(new InvalidArgumentException()); $result = $this->getDecorator()->decorate(new ParameterBag(['paramFetcher' => $this->paramFetcher, '_route' => true]), $data); $this->assertEquals($data, $result); }
public function testCollectionResponse() { $data = new CollectionRepresentation([new PaginatedTestClass()]); $this->paramFetcher->method('get')->willReturn(7); $result = $this->getDecorator()->decorate(new ParameterBag(['paramFetcher' => $this->paramFetcher, '_route' => true]), $data); $this->assertInstanceOf(PaginatedRepresentation::class, $result); $this->assertEquals($data, $result->getInline()); }