Пример #1
0
 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);
 }
Пример #2
0
 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));
 }
Пример #3
0
 /**
  * @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);
 }