Skip to content

Commit

Permalink
Add missing willReturn() calls to prophecized pdo objects to match ne…
Browse files Browse the repository at this point in the history
…w phpspec requirements

Signed-off-by: pine3ree <[email protected]>
  • Loading branch information
pine3ree committed Jul 11, 2024
1 parent a1cfda7 commit 19b083c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/DbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public function testQueryCall()
$pdo = $this->prophesize(PDO::class);
$db = new Db($pdo->reveal());

$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1)->willReturn('ansi');
$pdo->query($sql)->shouldBeCalled();

$db->query($sql);
Expand Down Expand Up @@ -499,7 +499,7 @@ public function testExecCall()
$pdo = $this->prophesize(PDO::class);
$db = new Db($pdo->reveal());

$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1)->willReturn('ansi');
$pdo->exec($sql)->shouldBeCalled();

$db->exec($sql);
Expand Down Expand Up @@ -542,7 +542,7 @@ public function testTransactionMethodsWithoutBeginningTransaction()
public function testTransactionMethods()
{
$pdo = $this->prophesize(PDO::class);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1)->willReturn('ansi');

$db = new Db($pdo->reveal());

Expand Down Expand Up @@ -591,7 +591,7 @@ public function testTransactionMethods()
public function testBeginTransactionRaisesExceptionIfPdoAlreadyDid()
{
$pdo = $this->prophesize(PDO::class);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1)->willReturn('ansi');

$db = new Db($pdo->reveal());
$pdo->inTransaction()->shouldBeCalled()->willReturn(true);
Expand All @@ -604,7 +604,7 @@ public function testBeginTransactionRaisesExceptionIfPdoAlreadyDid()
public function testCommitRaisesExceptionIfInRollBackState()
{
$pdo = $this->prophesize(PDO::class);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1);
$pdo->getAttribute(PDO::ATTR_DRIVER_NAME)->shouldBeCalledTimes(1)->willReturn('ansi');

$db = new Db($pdo->reveal());

Expand Down

0 comments on commit 19b083c

Please sign in to comment.