| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class NotificationFactoryTest extends AbstractTest |
||
| 15 | { |
||
| 16 | |||
| 17 | public function testCreateWithOneParam() |
||
| 18 | { |
||
| 19 | app()->set('app', new Application()); |
||
|
|
|||
| 20 | |||
| 21 | $notification = NotificationFactory::create('fundraising-page', 'pending', 'org_supporters', ['789']); |
||
| 22 | |||
| 23 | self::assertInstanceOf(Notification::class, $notification); |
||
| 24 | self::assertSame($notification->param, '789'); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param $class |
||
| 29 | * @param $recipient |
||
| 30 | * @param $target |
||
| 31 | * @param $trigger |
||
| 32 | * @dataProvider generateNotificationNameData |
||
| 33 | */ |
||
| 34 | public function testGenerateNotificationName($class, $target, $trigger, $recipient) |
||
| 35 | { |
||
| 36 | app()->set('app', new Application()); |
||
| 37 | self::assertSame($class, NotificationFactory::generateNotificationName($target, $trigger, $recipient)); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | public function generateNotificationNameData() |
||
| 51 | ], |
||
| 52 | ]; |
||
| 53 | } |
||
| 55 |