コード例 #1
0
ファイル: ResponseTest.php プロジェクト: xintang22/Paxifi
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testThrowExceptionIfRespondWithPaginatedCollectionButContentIsNotPaginatorInterface()
 {
     $response = new Response($fractal = m::mock('League\\Fractal\\Manager'), m::mock('Paxifi\\Support\\Response\\Item'), $collection = m::mock('Paxifi\\Support\\Response\\Collection'), $paginator = m::mock('Paxifi\\Support\\Response\\Paginator'), m::mock('Paxifi\\Support\\Response\\Cursor'));
     $response->setContent('foo');
     $response->setTransformer($transformer = m::mock('League\\Fractal\\TransformerAbstract'));
     $collection->shouldReceive('setData')->once()->with('foo');
     $collection->shouldReceive('setTransformer')->once()->with($transformer);
     $response->withCollection(true);
 }