Skip to content

Commit

Permalink
PHP-CS-Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper committed Dec 19, 2023
1 parent 73d84d8 commit 0a5e5f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function onFlush(OnFlushEventArgs $args): void

// Initialize a new LoggerChain with the new AuditLogger + the existing SQLLoggers.
$loggerChain = new LoggerChain();
if ($currentLogger !== null) {
if (null !== $currentLogger) {
$loggerChain->addLogger($currentLogger);
}
$loggerChain->addLogger($auditLogger);
Expand Down
30 changes: 18 additions & 12 deletions tests/Provider/Doctrine/Event/DoctrineSubscriberTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DH\Auditor\Tests\Provider\Doctrine\Event;

use DH\Auditor\Provider\Doctrine\Auditing\Event\DoctrineSubscriber;
Expand All @@ -12,7 +14,12 @@
use Doctrine\ORM\Event\OnFlushEventArgs;
use PHPUnit\Framework\TestCase;

class DoctrineSubscriberTest extends TestCase
/**
* @internal
*
* @small
*/
final class DoctrineSubscriberTest extends TestCase
{
public function testIssue185(): void
{
Expand All @@ -23,24 +30,23 @@ public function testIssue185(): void

$objectManager
->method('getConnection')
->willReturn($connection = $this->createMock(Connection::class));
->willReturn($connection = $this->createMock(Connection::class))
;

$connection
->method('getDriver')
->willReturn($driver = $this->createMock(Driver::class));
->willReturn($driver = $this->createMock(Driver::class))
;

$connection
->method('getConfiguration')
->willReturn($configuration = new Configuration());
->willReturn($configuration = new Configuration())
;

$configuration->setSQLLogger(new class implements SQLLogger {
public function startQuery($sql, ?array $params = null, ?array $types = null)
{
}
$configuration->setSQLLogger(new class() implements SQLLogger {
public function startQuery($sql, ?array $params = null, ?array $types = null): void {}

public function stopQuery()
{
}
public function stopQuery(): void {}
});

$target = new DoctrineSubscriber($transactionManager);
Expand All @@ -53,4 +59,4 @@ public function stopQuery()
$result = $configuration->getSQLLogger();
self::assertCount(2, $result->getLoggers());
}
}
}

0 comments on commit 0a5e5f3

Please sign in to comment.