Codeception\Module\WPQueries::assertQueriesByStatementAndFunction PHP Method

assertQueriesByStatementAndFunction() public method

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByStatementAndFunction ( string $statement, string $function, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$function string
$message string An optional message to override the default one.
    public function assertQueriesByStatementAndFunction($statement, $function, $message = '')
    {
        $this->readQueries();
        $message = $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);
        \PHPUnit_Framework_Assert::assertNotEmpty(iterator_to_array($statementIterator), $message);
    }