prepareDatabase([ 'users' => [ $this->normalUser() ] ]); } private function add_channel() { $this->extend((new Notification)->addChannel('test')); } /** * @test */ public function can_enable_notification_channel() { $this->add_channel(); /** @var User $user */ $user = User::find(2); NotificationPreference::setNotificationPreference($user, 'test', 'newPost'); $this->assertTrue( $user->notificationPreferences() ->where('channel', 'test') ->where('type', 'newPost') ->get('enabled') ); } }