-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6.x] Fix notifications database channel for anonymous notifiables (#…
…33409) * Prevent usage of database channel with anonymous notifiable * Prevent sending for anonymous notifiables and database channel * Update AnonymousNotifiable.php * Update NotificationRoutesNotificationsTest.php Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information
1 parent
c914a3e
commit 1116adb
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
use Illuminate\Container\Container; | ||
use Illuminate\Contracts\Notifications\Dispatcher; | ||
use Illuminate\Notifications\RoutesNotifications; | ||
use Illuminate\Support\Facades\Notification; | ||
use InvalidArgumentException; | ||
use Mockery as m; | ||
use PHPUnit\Framework\TestCase; | ||
use stdClass; | ||
|
@@ -50,6 +52,15 @@ public function testNotificationOptionRouting() | |
$this->assertSame('bar', $instance->routeNotificationFor('foo')); | ||
$this->assertSame('[email protected]', $instance->routeNotificationFor('mail')); | ||
} | ||
|
||
public function testOnDemandNotificationsCannotUseDatabaseChannel() | ||
{ | ||
$this->expectExceptionObject( | ||
new InvalidArgumentException('The database channel does not support on-demand notifications.') | ||
); | ||
|
||
Notification::route('database', 'foo'); | ||
} | ||
} | ||
|
||
class RoutesNotificationsTestInstance | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters