make()->toArray(); $attrs['password'] = Hash::make('secret'); $user = $userSvc->createUser($attrs); $this->assertEquals(UserState::ACTIVE, $user->state); Event::assertDispatched(UserRegistered::class, function ($e) use ($user) { return $e->user->id === $user->id && $e->user->state === $user->state; }); /*Notification::assertSentTo( [$user], \App\Notifications\Messages\UserRegistered::class );*/ } }