From 33823d75f5ac9d799a9b4e6d097c84fa56683d9b Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Fri, 10 Jan 2025 09:52:20 +0100 Subject: [PATCH] wip --- .github/workflows/run-tests.yml | 15 ++++++++------- tests/GithubIssueHandlerFactoryTest.php | 18 +++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c89f771..ba88055 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -3,11 +3,11 @@ name: run-tests on: push: paths: - - '**.php' - - '.github/workflows/run-tests.yml' - - 'phpunit.xml.dist' - - 'composer.json' - - 'composer.lock' + - "**.php" + - ".github/workflows/run-tests.yml" + - "phpunit.xml.dist" + - "composer.json" + - "composer.lock" jobs: test: @@ -23,7 +23,8 @@ jobs: include: - laravel: 11.* testbench: 9.* - carbon: ^2.63 + - laravel: 10.* + testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -45,7 +46,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.os == 'windows-latest' && '^^^' || '' }}${{ matrix.carbon }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: List Installed Dependencies diff --git a/tests/GithubIssueHandlerFactoryTest.php b/tests/GithubIssueHandlerFactoryTest.php index b9c5608..399e5c8 100644 --- a/tests/GithubIssueHandlerFactoryTest.php +++ b/tests/GithubIssueHandlerFactoryTest.php @@ -1,11 +1,12 @@ 'test/repo', 'token' => 'fake-token', @@ -16,21 +17,20 @@ $factory = new GithubIssueHandlerFactory; $handler = $factory($config); - expect($handler) - ->toBeInstanceOf(GithubIssueLoggerHandler::class) - ->and($handler->getFormatter()) - ->toBeInstanceOf(GithubIssueFormatter::class) - ->and($handler->getLevel()) - ->toBe(Level::Error); + expect($logger) + ->toBeInstanceOf(Logger::class) + ->and($logger->getName())->toBe('github') + ->and($logger->getHandlers()[0]) + ->toBeInstanceOf(GithubIssueLoggerHandler::class); }); test('it throws exception for missing required config', function () { $factory = new GithubIssueHandlerFactory; - expect(fn () => $factory([])) + expect(fn() => $factory([])) ->toThrow(InvalidArgumentException::class, 'GitHub repository is required'); - expect(fn () => $factory(['repo' => 'test/repo'])) + expect(fn() => $factory(['repo' => 'test/repo'])) ->toThrow(InvalidArgumentException::class, 'GitHub token is required'); });