Exemplo n.º 1
0
 private function verifyEventEquality($expectedEvent, $actualEvent)
 {
     if (0 !== strcmp(get_class($expectedEvent), get_class($actualEvent))) {
         return false;
     }
     $matcher = new EqualFieldsMatcher($expectedEvent);
     if (!$matcher->matches($actualEvent)) {
         $this->reporter->reportDifferentEventContents(get_class($expectedEvent), $matcher->getFailedField(), $matcher->getFailedFieldActualValue(), $matcher->getFailedFieldExpectedValue());
     }
     return true;
 }
Exemplo n.º 2
0
 private function assertCommandEquality($commandIndex, $expected, $actual)
 {
     if ($expected !== $actual) {
         if (get_class($expected) !== get_class($actual)) {
             throw new GovernorAssertionError(sprintf("Wrong command type at index %s (0-based). Expected <%s>, but got <%s>", $commandIndex, get_class($expected), get_class($actual)));
         }
     }
     $matcher = new EqualFieldsMatcher($expected);
     if (!$matcher->matches($actual)) {
         throw new GovernorAssertionError(sprintf("Unexpected command at index %s (0-based). " . "Field value of '%s.%s', expected <%s>, but got <%s>", $commandIndex, get_class($expected), $matcher->getFailedField(), $matcher->getFailedFieldExpectedValue(), $matcher->getFailedFieldActualValue()));
     }
 }