public function MessageDigestSubContext::assertDigestEmpty in Message Digest 8
Checks that the given digest for a user does not contain any messages.
@Then the :interval digest for :username should not contain any messages
Parameters
string $interval: The digest interval, e.g. 'daily' or 'weekly'.
string $username: The name of the user who should not have any messages in their digest.
File
- ./
message_digest.behat.inc, line 135 - Contains \MessageDigestSubContext.
Class
- MessageDigestSubContext
- Behat step definitions for the Message Digest module.
Code
public function assertDigestEmpty($interval, $username) {
$notifier = $this
->getMessageDigestNotifierForInterval($interval);
$user = user_load_by_name($username);
$messages = $this
->getUserMessagesByNotifier($notifier, $user
->id());
Assert::assertEmpty($messages, "The {$interval} digest for {$username} is empty.");
}