public function testSave() { $newUser = new User(); $newUser->setName('The Doctor'); $newUser->setAlias('doctorwho'); $newUser->setEmail('*****@*****.**'); $result = $this->object->save($this->mapper, $newUser); $this->assertTrue((bool) $result); }
public function testGetData() { $object = new User(); $object->setId(3); $object->setAlias('the-doctor'); $object->setName('Tenth'); $object->setEmail('*****@*****.**'); $data = ['id' => 3, 'alias' => 'the-doctor', 'name' => 'Tenth', 'email' => '*****@*****.**']; $this->assertInternalType('array', $this->object->getData($object)); $this->assertSame($data, $this->object->getData($object)); }
/** * @covers Drakojn\Io\Mapper::save */ public function testSave() { $newUser = new User(); $newUser->setName('The Doctor'); $newUser->setAlias('doctorwho'); $newUser->setEmail('*****@*****.**'); $hashControl = spl_object_hash($newUser); $result = $this->object->save($newUser); $this->assertEquals(true, (bool) $result); }