public function testFinalizeMap() { $data = Util::loadData('child'); $obj = GraphObjectChild::map($data, 'test-finalize-map'); $this->assertSame('astringvalue', $obj->aString); $this->assertSame(5, $obj->anInteger); $this->assertSame(false, $obj->aBoolean); $this->assertTrue(Util::arrays_are_similar(array('a', 'b', 'c', 'd'), $obj->flatArray)); $this->assertSame(7.0, $obj->aDouble); $this->assertSame('anotherstringvalue__append_finalize_value', $obj->childValueStr); $this->assertSame(true, $obj->childValueBool); $this->assertInstanceOf('Nuad\\Graph\\Test\\GraphObjectChild', $obj); }
public function testMapEmpty() { $dataBase = Util::loadData('base_weak_types'); $dataChild = Util::loadData('child_parent_diff'); $obj = GraphObjectChild::map($dataBase); $obj->mapEmpty($dataChild); $this->assertSame('astringvalue', $obj->aString); $this->assertSame(5, $obj->anInteger); $this->assertSame(false, $obj->aBoolean); $this->assertTrue(Util::arrays_are_similar(array('a', 'b', 'c', 'd'), $obj->flatArray)); $this->assertSame(5.5, $obj->aDouble); $this->assertSame('anotherstringvaluewithdiff', $obj->childValueStr); $this->assertSame(false, $obj->childValueBool); $this->assertInstanceOf('Nuad\\Graph\\Test\\GraphObjectChild', $obj); }