Laravel 4 Model Events don't work with PHPUnit
问题 I build a model side validation in Laravel 4 with the creating Model Event : class User extends Eloquent { public function isValid() { return Validator::make($this->toArray(), array('name' => 'required'))->passes(); } public static function boot() { parent::boot(); static::creating(function($user) { echo "Hello"; if (!$user->isValid()) return false; }); } } It works well but I have issues with PHPUnit. The two following tests are exactly the same but juste the first one pass : class UserTest