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

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

@example
```php
$this->assertCount(3, Acme\get_orphaned_posts());
Acme\delete_orphaned_posts();
$this->assertQueriesCountByFunction(3, 'Acme\delete_orphaned_posts');
```

@param int $n The expected number of queries.
@param string $function The function to check the queries for.
@param string $message An optional message to override the default one.
Asserts that n queries were made by the specified function .