From afc1295940c4dc3d2edc4993758561c8da29c8f4 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Fri, 22 Sep 2023 11:07:31 +0200 Subject: [PATCH] allow Symfony 7 (#130) --- .github/workflows/ci.yml | 2 ++ composer.json | 6 +++--- tests/LoggerTest.php | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 tests/LoggerTest.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2da7a8f..da541b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,8 @@ jobs: - php: 8.0 - php: 8.1 - php: 8.2 + SYMFONY_REQUIRE: 7.0.* + stability: dev steps: - uses: actions/checkout@v2 diff --git a/composer.json b/composer.json index 5b128b9..830eb5d 100644 --- a/composer.json +++ b/composer.json @@ -12,12 +12,12 @@ ], "require": { "php": "^7.3 || ^8.0", - "symfony/framework-bundle": "^5.4 || ^6.2", + "symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0", "solarium/solarium": "^6.2" }, "require-dev": { - "symfony/phpunit-bridge": "^6.2", - "symfony/stopwatch": "^5.4 || ^6.2" + "symfony/phpunit-bridge": "^6.3", + "symfony/stopwatch": "^5.4 || ^6.2 || ^7.0" }, "autoload": { "psr-4": { diff --git a/tests/LoggerTest.php b/tests/LoggerTest.php new file mode 100644 index 0000000..2206262 --- /dev/null +++ b/tests/LoggerTest.php @@ -0,0 +1,28 @@ +setLogger(new NullLogger()); + $logger->setStopwatch(new Stopwatch()); + + $logger->log(new Request(), null, $this->createMock(Endpoint::class), 0); + $logger->collect(new SymfonyRequest(), new Response()); + + $this->assertSame(1, $logger->getQueryCount()); + $this->assertCount(1, $logger->getQueries()); + } +}