-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed the rest of mock classes #3555
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
use Doctrine\DBAL\DBALException; | ||
use Doctrine\DBAL\Driver; | ||
use Doctrine\DBAL\Driver\Connection as DriverConnection; | ||
use Doctrine\DBAL\Driver\ServerInfoAwareConnection; | ||
use Doctrine\DBAL\Driver\Statement; | ||
use Doctrine\DBAL\DriverManager; | ||
use Doctrine\DBAL\Events; | ||
|
@@ -21,10 +22,8 @@ | |
use Doctrine\DBAL\Logging\EchoSQLLogger; | ||
use Doctrine\DBAL\ParameterType; | ||
use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
use Doctrine\DBAL\VersionAwarePlatformDriver; | ||
use Doctrine\Tests\DbalTestCase; | ||
use Doctrine\Tests\Mocks\DriverStatementMock; | ||
use Doctrine\Tests\Mocks\ServerInfoAwareConnectionMock; | ||
use Doctrine\Tests\Mocks\VersionAwarePlatformDriverMock; | ||
use Exception; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
use stdClass; | ||
|
@@ -525,7 +524,7 @@ public function testFetchAssoc() | |
$this->createMock(DriverConnection::class) | ||
)); | ||
|
||
$driverStatementMock = $this->createMock(DriverStatementMock::class); | ||
$driverStatementMock = $this->createMock(Statement::class); | ||
|
||
$driverStatementMock->expects($this->once()) | ||
->method('fetch') | ||
|
@@ -561,7 +560,7 @@ public function testFetchArray() | |
$this->createMock(DriverConnection::class) | ||
)); | ||
|
||
$driverStatementMock = $this->createMock(DriverStatementMock::class); | ||
$driverStatementMock = $this->createMock(Statement::class); | ||
|
||
$driverStatementMock->expects($this->once()) | ||
->method('fetch') | ||
|
@@ -598,7 +597,7 @@ public function testFetchColumn() | |
$this->createMock(DriverConnection::class) | ||
)); | ||
|
||
$driverStatementMock = $this->createMock(DriverStatementMock::class); | ||
$driverStatementMock = $this->createMock(Statement::class); | ||
|
||
$driverStatementMock->expects($this->once()) | ||
->method('fetchColumn') | ||
|
@@ -634,7 +633,7 @@ public function testFetchAll() | |
$this->createMock(DriverConnection::class) | ||
)); | ||
|
||
$driverStatementMock = $this->createMock(DriverStatementMock::class); | ||
$driverStatementMock = $this->createMock(Statement::class); | ||
|
||
$driverStatementMock->expects($this->once()) | ||
->method('fetchAll') | ||
|
@@ -732,11 +731,11 @@ public function testCallConnectOnce($method, $params) | |
*/ | ||
public function testPlatformDetectionIsTriggerOnlyOnceOnRetrievingPlatform() | ||
{ | ||
/** @var VersionAwarePlatformDriverMock|MockObject $driverMock */ | ||
$driverMock = $this->createMock(VersionAwarePlatformDriverMock::class); | ||
/** @var Driver|VersionAwarePlatformDriver|MockObject $driverMock */ | ||
$driverMock = $this->createMock([Driver::class, VersionAwarePlatformDriver::class]); | ||
|
||
/** @var ServerInfoAwareConnectionMock|MockObject $driverConnectionMock */ | ||
$driverConnectionMock = $this->createMock(ServerInfoAwareConnectionMock::class); | ||
/** @var ServerInfoAwareConnection|MockObject $driverConnectionMock */ | ||
$driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class); | ||
|
||
/** @var AbstractPlatform|MockObject $platformMock */ | ||
$platformMock = $this->getMockForAbstractClass(AbstractPlatform::class); | ||
|
@@ -861,8 +860,8 @@ public function testThrowsExceptionWhenInValidPlatformSpecified() : void | |
*/ | ||
public function testRethrowsOriginalExceptionOnDeterminingPlatformWhenConnectingToNonExistentDatabase() | ||
{ | ||
/** @var VersionAwarePlatformDriverMock|MockObject $driverMock */ | ||
$driverMock = $this->createMock(VersionAwarePlatformDriverMock::class); | ||
/** @var Driver|VersionAwarePlatformDriver|MockObject $driverMock */ | ||
$driverMock = $this->createMock([Driver::class, VersionAwarePlatformDriver::class]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will have to be reworked due to sebastianbergmann/phpunit#3955. |
||
|
||
$connection = new Connection(['dbname' => 'foo'], $driverMock); | ||
$originalException = new Exception('Original exception'); | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have to be reworked due to sebastianbergmann/phpunit#3955.