Skip to content

Commit 59c5c67

Browse files
committed
Pass all required arguments to initialisation of Pdo
Pdo's constructor requires three mandatory arguments: a AbstractPdoConnection|PDO object, a StatementInterface&PdoDriverAwareInterface object, and a ResultInterface object. This change mocks the second and third arguments to ensure, which were missing.
1 parent 7bdd563 commit 59c5c67

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/unit/Driver/Pdo/PdoTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
use Override;
88
use PhpDb\Adapter\Driver\Pdo\Result;
9+
use PhpDb\Adapter\Driver\PdoDriverAwareInterface;
910
use PhpDb\Adapter\Driver\PdoDriverInterface;
11+
use PhpDb\Adapter\Driver\ResultInterface;
12+
use PhpDb\Adapter\Driver\StatementInterface;
1013
use PhpDb\Adapter\Sqlite\Driver\Pdo\Connection;
1114
use PhpDb\Adapter\Sqlite\Driver\Pdo\Pdo;
1215
use PhpDb\Exception\RuntimeException;
@@ -29,7 +32,17 @@ protected function setUp(): void
2932
{
3033
$connection = new Connection();
3134

32-
$this->pdo = new Pdo($connection);
35+
/** @var StatementInterface&PdoDriverAwareInterface $statementPrototype */
36+
$statementPrototype = $this->createMockForIntersectionOfInterfaces([
37+
StatementInterface::class,
38+
PdoDriverAwareInterface::class,
39+
]);
40+
41+
$this->pdo = new Pdo(
42+
$connection,
43+
$statementPrototype,
44+
$this->createMock(ResultInterface::class),
45+
);
3346
}
3447

3548
public function testGetDatabasePlatformName(): void

0 commit comments

Comments
 (0)