Created
March 20, 2019 17:16
-
-
Save salahm/1ea13144a447a199081215b079087acd to your computer and use it in GitHub Desktop.
Get dispatched messages with messenger and behat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$driver = $this->session->getDriver(); | |
/** @var Client $client */ | |
$client = $driver->getClient(); | |
$nbDispatchedMessages = count($client->getProfile()->getCollector('messenger')->getMessages()); | |
if ($count !== $nbDispatchedMessages) { | |
throw new ExpectationException( | |
sprintf('Dispatched messages should be equal to %s, actual : %s', $count, $nbDispatchedMessages), | |
$driver | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment