src/Codeception/Module/WPQueries.php
public function assertQueriesByStatementAndFunction($statement, $function, $message = '')
    {
        $this->readQueries();
        $message = $message ?: 'Failed asserting that queries were made by function ['
                               . $function . '] containing statement [' . $statement . ']';
        $statementIterator = new MainStatementQueriesFilter(new FunctionQueriesFilter(
            new \ArrayIterator($this->filteredQueries),
            $function
        ), $statement);
        Assert::assertNotEmpty(iterator_to_array($statementIterator), $message);
    }
public function assertQueriesByStatementAndFunction($statement, $function, $message = '')
    {
        $this->readQueries();
        $message = $message ?: 'Failed asserting that queries were made by function ['
                               . $function . '] containing statement [' . $statement . ']';
        $statementIterator = new MainStatementQueriesFilter(new FunctionQueriesFilter(
            new \ArrayIterator($this->filteredQueries),
            $function
        ), $statement);
        Assert::assertNotEmpty(iterator_to_array($statementIterator), $message);
    }
public function assertQueriesByStatementAndFunction ( $ statement , $ function , $ message = '' ) { $ this -> readQueries ( ) ; $ message = $ message ? : 'Failed asserting that queries were made by function [' . $ function . '] containing statement [' . $ statement . ']' ; $ statementIterator = new MainStatementQueriesFilter ( new FunctionQueriesFilter ( new \ ArrayIterator ( $ this -> filteredQueries ) , $ function ) , $ statement ) ; Assert :: assertNotEmpty ( iterator_to_array ( $ statementIterator ) , $ message ) ; }
Asserts that queries were made by the specified function starting with the specified SQL statement.

Queries generated by `setUp`, `tearDown` and `factory` methods are excluded by default.

@example
```php
wp_insert_post(['post_type' => 'book', 'post_title' => 'Alice in Wonderland']);
$this->assertQueriesByStatementAndFunction('INSERT', 'wp_insert_post');
```

@param string $statement A simple string the statement should start with or a valid regular expression.
Regular expressions must contain delimiters.
@param string $function The fully qualified function name.
@param string $message An optional message to override the default one.
Asserts that queries were made by the specified function starting with the specified SQL statement .