$driverConnection ->
expects(self::
any()) ->
method('executeQuery'
) ->
willReturn(new Result(new ArrayResult([]),
$driverConnection));
} $connection =
new PostgreSqlConnection(['table_name' => 'queue_table'
],
$driverConnection);
$connection->
get(); // first time we have queueEmptiedAt === null, fallback on the parent implementation
$connection->
get();
$connection->
get();
$this->
assertSame(2,
$wrappedConnection->
countNotifyCalls());
} public function testGetExtraSetupSql() { $driverConnection =
$this->
createMock(\Doctrine\DBAL\Connection::
class);
$driverConnection->
method('executeStatement'
)->
willReturn(1
);
$connection =
new PostgreSqlConnection(['table_name' => 'queue_table'
],
$driverConnection);
$table =
new Table('queue_table'
);
$table->
addOption('_symfony_messenger_table_name', 'queue_table'
);
$sql =
implode("\n",
$connection->
getExtraSetupSqlForTable($table));