Exemplo n.º 1
0
 public function testCollection()
 {
     $collection = new Response();
     $entity = new EntityResponse();
     $entity->setId(1);
     $collection->offsetSet('test', $entity);
     $this->assertInstanceOf('\\Jdolieslager\\JsonRpc\\Collection\\Response', $collection);
     $this->assertInstanceOf('Jdolieslager\\JsonRpc\\Entity\\Response', $collection->offsetGet('test'));
     $copy = $collection->getArrayCopy();
     $this->assertInternalType('array', $copy);
     $this->assertArrayHasKey('test', $copy);
     $this->assertArrayHasKey('id', $copy['test']);
     $this->assertEquals(1, $copy['test']['id']);
 }