예제 #1
0
 public function Test_of__create()
 {
     $Users = new AkTestUser('first_name=>', 'Tim', 'last_name->', 'Horton', 'user_name->', 'tim', 'email->', '*****@*****.**', 'expires_on->', '+2 years');
     $Users->_create();
     $User = new AkTestUser($Users->getId());
     $this->assertTrue($User->first_name == 'Tim' && $User->last_name == 'Horton' && $User->user_name == 'tim' && $User->email == '*****@*****.**');
     $this->assertFalse(empty($User->created_at) && empty($User->expires_on));
     $this->assertEqual(count($User->getAttributes()), 10);
     $User->delete($Users->getId());
 }
예제 #2
0
 public function test_should_save_record()
 {
     $Users = new AkTestUser(array('first_name' => 'Tim', 'last_name' => 'Horton', 'user_name' => 'tim', 'email' => '*****@*****.**', 'expires_on' => '+2 years'));
     $Users->save();
     $User = new AkTestUser($Users->getId());
     $this->assertTrue($User->first_name == 'Tim' && $User->last_name == 'Horton' && $User->user_name == 'tim' && $User->email == '*****@*****.**');
     $this->assertFalse(empty($User->created_at) && empty($User->expires_on));
     $this->assertEqual(count($User->getAttributes()), 10);
     $User->delete($Users->getId());
 }