Skip to content

Commit

Permalink
Merge pull request #7 from emptyhand/fix-database-checker
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
gedasli authored Nov 23, 2021
2 parents f213818 + ba51f15 commit 3fc8efb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/Unit/Services/DatabaseCheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,22 @@ public function testCheckStatus(
->getMock()
;

$pdoMock = $this
->getMockBuilder(\PDO::class)
->disableOriginalConstructor()
->onlyMethods(['prepare'])
->getMock();

$pdoMock
->expects($this->once())
->method('prepare')
->willReturn($this->createMock(\PDOStatement::class));

$databaseCheckerMock
->expects(static::once())
->method('createConnection')
->with(...$expectedPdoArgs)
->willReturn($this->createMock(\PDO::class))
->willReturn($pdoMock)
;

$actualResult = $databaseCheckerMock->checkStatus();
Expand Down

0 comments on commit 3fc8efb

Please sign in to comment.