Skip to content

Commit

Permalink
Address warning from PHPUnit
Browse files Browse the repository at this point in the history
This hack is temporary and should be removed on 3.0.x
  • Loading branch information
greg0ire committed May 27, 2020
1 parent 7fc2268 commit 9d73084
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/Doctrine/Tests/DBAL/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Doctrine\DBAL\Logging\EchoSQLLogger;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\VersionAwarePlatformDriver;
use Doctrine\Tests\DbalTestCase;
use Exception;
use PHPUnit\Framework\MockObject\MockObject;
Expand Down Expand Up @@ -762,7 +761,7 @@ public function testCallConnectOnce(string $method, array $params) : void
*/
public function testPlatformDetectionIsTriggerOnlyOnceOnRetrievingPlatform() : void
{
$driverMock = $this->createMock([Driver::class, VersionAwarePlatformDriver::class]);
$driverMock = $this->createMock(FutureVersionAwarePlatformDriver::class);

$driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class);

Expand Down Expand Up @@ -883,7 +882,7 @@ public function testThrowsExceptionWhenInValidPlatformSpecified() : void
*/
public function testRethrowsOriginalExceptionOnDeterminingPlatformWhenConnectingToNonExistentDatabase() : void
{
$driverMock = $this->createMock([Driver::class, VersionAwarePlatformDriver::class]);
$driverMock = $this->createMock(FutureVersionAwarePlatformDriver::class);

$connection = new Connection(['dbname' => 'foo'], $driverMock);
$originalException = new Exception('Original exception');
Expand Down
15 changes: 15 additions & 0 deletions tests/Doctrine/Tests/DBAL/FutureVersionAwarePlatformDriver.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace Doctrine\Tests\DBAL;

use Doctrine\DBAL\Driver;
use Doctrine\DBAL\VersionAwarePlatformDriver;

/**
* Remove me in 3.0.x
*/
interface FutureVersionAwarePlatformDriver extends VersionAwarePlatformDriver, Driver
{
}

0 comments on commit 9d73084

Please sign in to comment.