src/Codeception/Module/WPQueries.php
public function assertQueriesByStatementAndAction($statement, $action, $message = '')
    {
        $this->readQueries();
        $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);
        Assert::assertNotEmpty(iterator_to_array($iterator), $message);
    }
public function assertQueriesByStatementAndAction($statement, $action, $message = '')
    {
        $this->readQueries();
        $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);
        Assert::assertNotEmpty(iterator_to_array($iterator), $message);
    }
public function assertQueriesByStatementAndAction ( $ statement , $ action , $ message = '' ) { $ this -> readQueries ( ) ; $ 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 ) ; Assert :: assertNotEmpty ( iterator_to_array ( $ iterator ) , $ message ) ; }
Asserts that at least one query was made as a consequence of the specified action containing the SQL query.

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

@example
```php
add_action( 'edit_post', function($postId){
$count = get_option('acme_title_updates_count');
update_option('acme_title_updates_count', ++$count);
} );
wp_update_post(['ID' => $bookId, 'post_title' => 'New']);
$this->assertQueriesByStatementAndAction('UPDATE', 'edit_post');
```

@param string $statement A simple string the statement should start with or a valid regular expression.
Regular expressions must contain delimiters.
@param string $action The action name, e.g. 'init'.
@param string $message An optional message to override the default one.
Asserts that at least one query was made as a consequence of the specified action containing the SQL query .