Codeception\Module\WPQueries::assertQueriesByStatementAndAction PHP Method

assertQueriesByStatementAndAction() public method

Queries generated by setUp, tearDown and factory methods are excluded by default.
public assertQueriesByStatementAndAction ( string $statement, string $action, string $message = '' )
$statement string A simple string the statement should start with or a valid regular expression. Regular expressions must contain delimiters.
$action string The action name, e.g. 'init'.
$message string An optional message to override the default one.
    public function assertQueriesByStatementAndAction($statement, $action, $message = '')
    {
        $this->readQueries();
        $message = $message ? $message : 'Failed asserting that queries were triggered by action  [' . $action . '] containing statement [' . $statement . ']';
        $iterator = new MainStatementQueriesFilter(new ActionsQueriesFilter(new \ArrayIterator($this->filteredQueries), $action), $statement);
        \PHPUnit_Framework_Assert::assertNotEmpty(iterator_to_array($iterator), $message);
    }