From b9e1c121256e95b34214058ba0b07204399eea81 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 3 Mar 2026 13:31:41 +0000 Subject: [PATCH] Apply fixes from StyleCI --- tests/BotTest.php | 28 ++++++++++++++-------------- tests/ConfigTest.php | 18 +++++++++--------- tests/NotifierTest.php | 6 +++--- tests/ValidatorTest.php | 10 +++++----- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tests/BotTest.php b/tests/BotTest.php index d95f505..a46683f 100644 --- a/tests/BotTest.php +++ b/tests/BotTest.php @@ -6,8 +6,8 @@ it('can be instantiated with default parameters', function () { $bot = new Bot( - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); expect($bot)->toBeInstanceOf(Bot::class) @@ -19,8 +19,8 @@ $event = new Event(); $bot = new Bot( event: $event, - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); expect($bot->event)->toBe($event); @@ -29,8 +29,8 @@ it('can be instantiated with custom platform', function () { $bot = new Bot( platform: 'github', - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); expect($bot->event->platform)->toBe('github'); @@ -40,8 +40,8 @@ $setting = new Setting(); $bot = new Bot( setting: $setting, - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); expect($bot->setting)->toBe($setting); @@ -49,8 +49,8 @@ it('sets default platform when not specified', function () { $bot = new Bot( - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); expect($bot->event->platform)->toBe('github'); @@ -60,8 +60,8 @@ // This should not throw if the platform file exists $bot = new Bot( platform: 'github', - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); expect($bot->event->getEventConfig())->toBeArray(); @@ -69,8 +69,8 @@ it('validates setting file on construction', function () { $bot = new Bot( - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); expect($bot->setting->getSettingFile())->not->toBeEmpty(); diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index aceb7a3..6a4072d 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -4,8 +4,8 @@ beforeEach(function () { $this->bot = new Bot( - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); }); @@ -14,7 +14,7 @@ }); it('platform can be set for event with platform parameter', function () { - $this->bot->setPlatFormForEvent('gitlab', __DIR__.'/../config/jsons/gitlab-events.json'); + $this->bot->setPlatFormForEvent('gitlab', __DIR__ . '/../config/jsons/gitlab-events.json'); expect($this->bot->event->platform)->toBe('gitlab'); }); @@ -24,33 +24,33 @@ }); it('platform can be set for event with platform file', function () { - $this->bot->setPlatFormForEvent('gitlab', __DIR__.'/../config/jsons/gitlab-events.json'); + $this->bot->setPlatFormForEvent('gitlab', __DIR__ . '/../config/jsons/gitlab-events.json'); expect($this->bot->event->platform)->toBe('gitlab') ->and($this->bot->event->platformFile) - ->toBe(__DIR__.'/../config/jsons/gitlab-events.json'); + ->toBe(__DIR__ . '/../config/jsons/gitlab-events.json'); }); it('can get json config for event - github', function () { - $this->bot->setPlatFormForEvent('github', __DIR__.'/../config/jsons/github-events.json'); + $this->bot->setPlatFormForEvent('github', __DIR__ . '/../config/jsons/github-events.json'); expect($this->bot->event->getEventConfig())->toBeArray() ->and($this->bot->event->getEventConfig())->toHaveKey('issue_comment'); }); it('can get json config for event - gitlab', function () { - $this->bot->setPlatFormForEvent('gitlab', __DIR__.'/../config/jsons/gitlab-events.json'); + $this->bot->setPlatFormForEvent('gitlab', __DIR__ . '/../config/jsons/gitlab-events.json'); expect($this->bot->event->getEventConfig())->toBeArray() ->and($this->bot->event->getEventConfig())->toHaveKey('tag_push'); }); it('setting file is valid', function () { - $this->bot->updateSetting(__DIR__.'/../config/jsons/tgn-settings.json'); + $this->bot->updateSetting(__DIR__ . '/../config/jsons/tgn-settings.json'); $this->bot->validateSettingFile(); expect($this->bot->setting->getSettings())->toBeArray(); }); it('platform file is valid', function () { - $this->bot->setPlatFormForEvent('github', __DIR__.'/../config/jsons/github-events.json'); + $this->bot->setPlatFormForEvent('github', __DIR__ . '/../config/jsons/github-events.json'); $this->bot->validatePlatformFile(); expect($this->bot->event->getEventConfig())->toBeArray(); diff --git a/tests/NotifierTest.php b/tests/NotifierTest.php index 30c5f19..217d38b 100644 --- a/tests/NotifierTest.php +++ b/tests/NotifierTest.php @@ -3,15 +3,15 @@ use CSlant\TelegramGitNotifier\Notifier; beforeEach(function () { - $this->notifier = new Notifier(platformFile: __DIR__.'/../config/jsons/github-events.json'); + $this->notifier = new Notifier(platformFile: __DIR__ . '/../config/jsons/github-events.json'); }); it('validates that the event files exist', function () { - $this->notifier->setPlatFormForEvent('gitlab', __DIR__.'/../config/jsons/gitlab-events.json'); + $this->notifier->setPlatFormForEvent('gitlab', __DIR__ . '/../config/jsons/gitlab-events.json'); expect($this->notifier->event->getEventConfig())->toBeArray() ->and($this->notifier->event->getEventConfig())->toHaveKey('tag_push'); - $this->notifier->setPlatFormForEvent('github', __DIR__.'/../config/jsons/github-events.json'); + $this->notifier->setPlatFormForEvent('github', __DIR__ . '/../config/jsons/github-events.json'); expect($this->notifier->event->getEventConfig())->toBeArray() ->and($this->notifier->event->getEventConfig()) ->toHaveKey('issue_comment'); diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php index 8fb97b4..ec92ddc 100644 --- a/tests/ValidatorTest.php +++ b/tests/ValidatorTest.php @@ -5,8 +5,8 @@ beforeEach(function () { $this->bot = new Bot( - platformFile: __DIR__.'/../config/jsons/github-events.json', - settingFile: __DIR__.'/../config/jsons/tgn-settings.json' + platformFile: __DIR__ . '/../config/jsons/github-events.json', + settingFile: __DIR__ . '/../config/jsons/tgn-settings.json' ); $this->validator = new Validator($this->bot->setting, $this->bot->event); }); @@ -29,13 +29,13 @@ }); it('can validate the event that has no action to send a notification - gitlab', function () { - $this->bot->setPlatFormForEvent('gitlab', __DIR__.'/../config/jsons/gitlab-events.json'); + $this->bot->setPlatFormForEvent('gitlab', __DIR__ . '/../config/jsons/gitlab-events.json'); $result = $this->validator->isAccessEvent('gitlab', 'push', (object)[]); expect($result)->toBeTrue(); }); it('can validate the event that has an action to send a notification - gitlab', function () { - $this->bot->setPlatFormForEvent('gitlab', __DIR__.'/../config/jsons/gitlab-events.json'); + $this->bot->setPlatFormForEvent('gitlab', __DIR__ . '/../config/jsons/gitlab-events.json'); $result = $this->validator->isAccessEvent('gitlab', 'merge_request', (object)[ 'action' => 'open', ]); @@ -43,7 +43,7 @@ }); it('can\'t validate the event that has an action but no payload to send a notification - gitlab', function () { - $this->bot->setPlatFormForEvent('gitlab', __DIR__.'/../config/jsons/gitlab-events.json'); + $this->bot->setPlatFormForEvent('gitlab', __DIR__ . '/../config/jsons/gitlab-events.json'); $result = $this->validator->isAccessEvent('gitlab', 'merge_request', (object)[]); expect($result)->toBeFalse(); });