Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Notification Channel Extender #2432

Merged
merged 15 commits into from
Nov 5, 2020
Prev Previous commit
Next Next commit
Add test for notification serializers
  • Loading branch information
SychO9 committed Nov 2, 2020
commit cb127b2b21f1565cae3ee276f9ed29ebbacd2382
31 changes: 31 additions & 0 deletions tests/integration/extenders/NotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ public function notification_type_doesnt_exist_by_default()
$this->assertArrayNotHasKey('customNotificationType', Notification::getSubjectModels());
}

/**
* @test
*/
public function notification_serializer_doesnt_exist_by_default()
{
$this->app();

$this->assertNotContains(
'customNotificationTypeSerializer',
$this->app->getContainer()->make('flarum.api.notification_serializers')
);
}

/**
* @test
*/
Expand All @@ -49,6 +62,24 @@ public function notification_type_exists_if_added()
$this->assertArrayHasKey('customNotificationType', Notification::getSubjectModels());
}

/**
* @test
*/
public function notification_serializer_exists_if_added()
{
$this->extend((new Extend\Notification)->type(
CustomNotificationType::class,
'customNotificationTypeSerializer'
));

$this->app();

$this->assertContains(
'customNotificationTypeSerializer',
$this->app->getContainer()->make('flarum.api.notification_serializers')
);
}

/**
* @test
*/
Expand Down