Beispiel #1
0
 public function test_failInsert_event()
 {
     $user = new Users();
     $user->on(Users::EVENT_BEFORE_INSERT, function ($e) {
         $e->isValid = false;
     });
     $user->username = '******';
     $user->password = '******';
     $user->access_token = 'token';
     $user->save();
     // failed
     $this->assertEmpty(Users::findIdentity($user->username));
 }