コード例 #1
0
 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);
 }
コード例 #2
0
 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());
 }