create(); $user = $userSvc->createUser($user); $this->assertEquals(UserState::ACTIVE, $user->state); Event::assertDispatched(\App\Events\UserRegistered::class, function ($e) use ($user) { return $e->user->id === $user->id && $e->user->state === $user->state; }); /*Mail::assertSent(\App\Mail\UserRegistered::class, function ($mail) use ($user) { return $mail->user->id === $user->id && $mail->user->state === $user->state; });*/ } }