/** * Assert that the given <code>expected</code> events have been published. * * @param array $expected the events that must have been published. * @throws GovernorAssertionError */ public function assertPublishedEvents(array $expected = array()) { if (count($this->publishedEvents) !== count($expected)) { throw new GovernorAssertionError(sprintf("Got wrong number of events published. Expected <%s>, got <%s>", count($expected), count($this->publishedEvents))); } $this->assertPublishedEventsMatching(Matchers::payloadsMatching(Matchers::exactSequenceOf($this->createEqualToMatchers($expected)))); }