| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function test_fireEvent() |
||
| 19 | { |
||
| 20 | $eventMock = \Mockery::mock(Event::class)->shouldAllowMockingProtectedMethods()->makePartial(); |
||
| 21 | $eventsMock = \Mockery::mock(Events::class)->shouldAllowMockingProtectedMethods()->makePartial(); |
||
| 22 | |||
| 23 | $eventMock->shouldReceive('getManager')->andReturn($eventsMock); |
||
| 24 | $eventMock->shouldReceive('save')->once(); |
||
| 25 | $eventsMock->shouldReceive('getNew')->andReturn($eventMock); |
||
| 26 | |||
| 27 | ModelLocator::set('Notifications\Events', $eventsMock); |
||
|
|
|||
| 28 | |||
| 29 | $model = new Record(); |
||
| 30 | |||
| 31 | $topic = new Topic(); |
||
| 32 | $event = $topic->fireEvent($model); |
||
| 33 | |||
| 34 | self::assertSame('pending', $event->getAttribute('status')); |
||
| 35 | } |
||
| 36 | } |