Exemplo n.º 1
0
 public function testTransformaEntitiesEmArrayAssociativo()
 {
     $data1 = $data2 = array('id' => 1, 'nome' => 'fooBar', 'estadoCivil' => 'solteiro', 'doador' => TRUE);
     $data2['id'] = 2;
     $data2['nome'] = 'barFoo';
     $entity1 = new CoreExt_EntityStub($data1);
     $entity2 = new CoreExt_EntityStub($data2);
     $entities = array($entity1, $entity2);
     $array = CoreExt_EntityStub::entityFilterAttr($entities, 'id', 'nome');
     $this->assertEquals(array(1 => 'fooBar', 2 => 'barFoo'), $array);
 }