src/Codeception/Module/WPQueries.php
public function assertCountQueries($n, $message = '')
    {
        $this->readQueries();
        $message = $message ? $message : 'Failed asserting that ' . $n . ' queries were made.';
        Assert::assertCount($n, $this->filteredQueries, $message);
    }
public function assertCountQueries($n, $message = '')
    {
        $this->readQueries();
        $message = $message ? $message : 'Failed asserting that ' . $n . ' queries were made.';
        Assert::assertCount($n, $this->filteredQueries, $message);
    }
public function assertCountQueries ( $ n , $ message = '' ) { $ this -> readQueries ( ) ; $ message = $ message ? $ message : 'Failed asserting that ' . $ n . ' queries were made.' ; Assert :: assertCount ( $ n , $ this -> filteredQueries , $ message ) ; }
Asserts that n queries have been made.

@example
```php
$posts = $this->factory()->post->create_many(3);
$cachedUsers = $this->factory()->user->create_many(2);
$nonCachedUsers = $this->factory()->user->create_many(2);
foreach($cachedUsers as $userId){
wp_cache_set('page-posts-for-user-' . $userId, $posts, 'acme');
}
// Run the same query as different users
foreach(array_merge($cachedUsers, $nonCachedUsers) as $userId){
$pagePosts = $plugin->getPagePostsForUser($userId);
}
$I->assertCountQueries(2, 'A query should be made for each user missing cached posts.')
```

@param int $n The expected number of queries.
@param string $message An optional message to override the default one.
Asserts that n queries have been made .