Skip to content

Commit

Permalink
fix(tests): pretend mode has been changed in Laravel 10.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetry committed Nov 11, 2023
1 parent 3543663 commit 55182aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/Connection/ReturningTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public function testExecutesNothingOnPretend(): void
$this->assertEquals([], $this->getConnection()->returningStatement('update example set str = ? where str = ? returning str', ['IS7PD2jn', '8lnreu2H']));
});

$this->assertEquals(['update example set str = ? where str = ? returning str'], array_column($queries, 'query'));
// The pretend mode has been changed in Laravel 10.30.0 to include the bindings in the query string
if (version_compare($this->app->version(), '10.30.0', '>=')) {
$this->assertEquals(["update example set str = 'IS7PD2jn' where str = '8lnreu2H' returning str"], array_column($queries, 'query'));
} else {
$this->assertEquals(['update example set str = ? where str = ? returning str'], array_column($queries, 'query'));
}
});

$this->assertEquals(1, $this->getConnection()->selectOne('SELECT COUNT(*) AS count FROM example WHERE str = ?', ['8lnreu2H'])->count);
Expand Down

0 comments on commit 55182aa

Please sign in to comment.