Skip to content

Commit 3fc8efb

Browse files
authored
Merge pull request #7 from emptyhand/fix-database-checker
Fix tests
2 parents f213818 + ba51f15 commit 3fc8efb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/Unit/Services/DatabaseCheckerTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,22 @@ public function testCheckStatus(
3232
->getMock()
3333
;
3434

35+
$pdoMock = $this
36+
->getMockBuilder(\PDO::class)
37+
->disableOriginalConstructor()
38+
->onlyMethods(['prepare'])
39+
->getMock();
40+
41+
$pdoMock
42+
->expects($this->once())
43+
->method('prepare')
44+
->willReturn($this->createMock(\PDOStatement::class));
45+
3546
$databaseCheckerMock
3647
->expects(static::once())
3748
->method('createConnection')
3849
->with(...$expectedPdoArgs)
39-
->willReturn($this->createMock(\PDO::class))
50+
->willReturn($pdoMock)
4051
;
4152

4253
$actualResult = $databaseCheckerMock->checkStatus();

0 commit comments

Comments
 (0)