public function it_should_allow_asserting_queries_by_statement()
{
$this->wpdb->queries = [['INSERT INTO ... (SELECT * ...)', 'some ms timing', 'a stack trace including Acme\\MyPlugin->someMethod'], ['SELECT ID FROM ... (SELECT...)', 'some ms timing', 'a stack trace including Acme\\MyPlugin->someMethod'], ['SELECT * FROM ... INSERT', 'some ms timing', 'a stack trace including Acme\\MyPlugin->someMethod'], ['UPDATE some_table... (SELECT', 'some ms timing', 'a stack trace including Acme\\MyPlugin->someMethod']];
$sut = $this->make_instance();
$sut->assertQueriesByStatement('SELECT');
$sut->assertQueriesCountByStatement(2, 'SELECT');
$this->expectException('PHPUnit_Framework_AssertionFailedError');
$sut->assertQueriesByStatement('DELETE');
$sut->assertNotQueriesByStatement('DELETE');
$this->expectException('PHPUnit_Framework_AssertionFailedError');
$sut->assertQueriesCountByStatement(1, 'SELECT');
$this->expectException('PHPUnit_Framework_AssertionFailedError');
$sut->assertQueriesCountByStatement(3, 'SELECT');
$sut->assertQueriesByStatement('UPDATE');
$sut->assertQueriesCountByStatement(1, 'UPDATE');
$this->expectException('PHPUnit_Framework_AssertionFailedError');
$sut->assertQueriesCountByStatement(2, 'UPDATE');
}