示例#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());
 }
示例#3
0
 function Test_of_getAttributes()
 {
     $User = new AkTestUser();
     $User->addCombinedAttributeConfiguration('name', "%s %s", 'first_name', 'last_name');
     $User->name = "Bermi Ferrer";
     $User->email = "*****@*****.**";
     $User->set('password', 'nada');
     $User->decomposeCombinedAttributes();
     $this->assertEqual($User->getAttributes(), array('id' => NULL, 'user_name' => NULL, 'first_name' => 'Bermi', 'last_name' => 'Ferrer', 'email' => '*****@*****.**', 'country' => NULL, 'password' => '*********', 'created_at' => NULL, 'updated_at' => NULL, 'expires_on' => NULL, 'name' => 'Bermi Ferrer'));
 }