/** * @test * @dataProvider countQueriesDataProvider * @param array $args * @param string $expectedQuery * @param array $expectedParameters */ public function countQueries(array $args, string $expectedQuery, array $expectedParameters) { $resultStatement = $this->getMockBuilder(Statement::class)->disableOriginalConstructor()->getMock(); $resultStatement->expects($this->once())->method('fetchColumn')->with(0)->will($this->returnValue(0)); $this->connection->expects($this->once())->method('executeQuery')->with($expectedQuery, $expectedParameters)->will($this->returnValue($resultStatement)); $this->connection->count(...$args); }