Skip to content

Commit

Permalink
allow Symfony 7 (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher authored Sep 22, 2023
1 parent 2326d50 commit afc1295
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
28 changes: 28 additions & 0 deletions tests/LoggerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Nelmio\SolariumBundle\Tests;

use Nelmio\SolariumBundle\Logger;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Solarium\Core\Client\Endpoint;
use Solarium\Core\Client\Request;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Stopwatch\Stopwatch;

class LoggerTest extends TestCase
{
public function testLog()
{
$logger = new Logger();
$logger->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());
}
}

0 comments on commit afc1295

Please sign in to comment.