src/Codeception/Module/WPQueries.php
public function assertQueriesByAction($action, $message = '')
    {
        $this->readQueries();
        $message = $message ? $message : 'Failed asserting that queries were triggered by action [' . $action . ']';
        $iterator = new ActionsQueriesFilter(new \ArrayIterator($this->filteredQueries), $action);
        Assert::assertNotEmpty(iterator_to_array($iterator, false), $message);
    }
public function assertQueriesByAction($action, $message = '')
    {
        $this->readQueries();
        $message = $message ? $message : 'Failed asserting that queries were triggered by action [' . $action . ']';
        $iterator = new ActionsQueriesFilter(new \ArrayIterator($this->filteredQueries), $action);
        Assert::assertNotEmpty(iterator_to_array($iterator, false), $message);
    }
public function assertQueriesByAction ( $ action , $ message = '' ) { $ this -> readQueries ( ) ; $ message = $ message ? $ message : 'Failed asserting that queries were triggered by action [' . $ action . ']' ; $ iterator = new ActionsQueriesFilter ( new \ ArrayIterator ( $ this -> filteredQueries ) , $ action ) ; Assert :: assertNotEmpty ( iterator_to_array ( $ iterator , false ) , $ message ) ; }
Asserts that at least one query was made as a consequence of the specified action.

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 Title']);
$this->assertQueriesByAction('edit_post');
```

@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 .