| 1 | <?php |
||
| 2 | |||
| 3 | use CSlant\TelegramGitNotifier\Notifier; |
||
| 4 | |||
| 5 | beforeEach(function () { |
||
| 6 | $this->nofitier = new Notifier(); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Loading history...
|
|||
| 7 | }); |
||
| 8 | |||
| 9 | it('validates that the event files exist', function () { |
||
| 10 | $this->nofitier->setPlatFormForEvent('gitlab', 'storage/json/tgn/gitlab-events.json'); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 11 | expect($this->nofitier->event->getEventConfig())->toBeArray() |
||
| 12 | ->and($this->nofitier->event->getEventConfig())->toHaveKey('tag_push'); |
||
| 13 | |||
| 14 | $this->nofitier->setPlatFormForEvent('github', 'storage/json/tgn/github-events.json'); |
||
| 15 | expect($this->nofitier->event->getEventConfig())->toBeArray() |
||
| 16 | ->and($this->nofitier->event->getEventConfig()) |
||
| 17 | ->toHaveKey('issue_comment'); |
||
| 18 | }); |
||
| 19 | |||
| 20 | it('can parse notification chat IDs', function () { |
||
| 21 | $chatThreadMapping = $this->nofitier->parseNotifyChatIds('-1201937489183;-1008168942527:46,2'); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 22 | expect($chatThreadMapping)->toBeArray() |
||
| 23 | ->and($chatThreadMapping)->toHaveKey('-1008168942527') |
||
| 24 | ->and($chatThreadMapping['-1008168942527'])->toBeArray() |
||
| 25 | ->and($chatThreadMapping['-1008168942527'])->toBe([ |
||
| 26 | 0 => '46', 1 => '2', |
||
| 27 | ]); |
||
| 28 | }); |
||
| 29 |