public function testKeysAreCorrectlySetBySetTransformerCalls()
 {
     $registry = new TransformerRegistry();
     $mock = new MockRegistryTransformer();
     $registry->setTransformer('mock', $mock);
     $this->assertTrue($registry->offsetExists('mock'));
     $this->assertSame($mock, $registry->offsetGet('mock'));
 }
 public function testTransformPaginatedObjectCollectionReturnsCorrectArray()
 {
     $collection = array(new \stdClass());
     $pager = new Pagerfanta(new MockPager($collection));
     $pagerAdapter = new PagerfantaPaginatorAdapter($pager, function () {
         return 'url';
     });
     $registry = new TransformerRegistry();
     $transformer = new ArrayTransformer(new Manager(), $registry);
     $registry->setTransformer('mock', new MockTransformer());
     $data = $transformer->transformList('mock', array(new \stdClass()), array('child'), $pagerAdapter);
     $this->assertEquals(array('data' => array(array('transformed' => true, 'child' => array('data' => array('transformed' => true)))), 'meta' => array('pagination' => array('total' => 1, 'count' => 1, 'per_page' => $pager->getMaxPerPage(), 'current_page' => 1, 'total_pages' => 1, 'links' => array()))), $data);
 }