Esempio n. 1
0
 public function testUpdate()
 {
     $update = User::update(joe()->id, array('name' => 'joe_updated'));
     $this->assertTrue(User::$callback_tests['before_update']);
     $this->assertTrue(User::$callback_tests['after_update']);
     $this->assertTrue(User::$callback_tests['before_validation']);
     $this->assertTrue(User::$callback_tests['after_validation']);
 }
Esempio n. 2
0
 public function testCanUpdateUserMyintNonNumeric()
 {
     $joe = joe();
     $update = User::update($joe->id, array('my_int' => 'l'));
     $this->assertFalse($update->saved);
     //reload joe
     $joe2 = User::_find($joe->id);
     //assert that nothing changed
     $this->assertTrue(is_null($joe2->my_int));
 }