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

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

@example
```php
$bookRepository = new Acme\BookRepository();
$repository->where('ID', 23)->set('title', 'Peter Pan', $deferred = true);
$repository->where('ID', 89)->set('title', 'Moby-dick', $deferred = true);
$repository->where('ID', 2389)->set('title', 'The call of the wild', $deferred = false);
$this->assertQueriesCountByStatement(1, 'INSERT', 'Deferred write should happen on __destruct');
```

@param int $n The expected number of queries.
@param string $statement A simple string the statement should start with or a valid regular expression.
Regular expressions must contain delimiters.
@param string $message An optional message to override the default one.
Asserts that n queries starting with the specified statement were made .