public function afterExample(ExampleEvent $exampleEvent)
{
$exception = $exampleEvent->getException();
if (!$exception instanceof NotEqualException) {
return;
}
if ($exception->getActual() !== null) {
return;
}
if (is_object($exception->getExpected()) || is_array($exception->getExpected()) || is_resource($exception->getExpected())) {
return;
}
if (!$this->lastMethodCallEvent) {
return;
}
$class = get_class($this->lastMethodCallEvent->getSubject());
$method = $this->lastMethodCallEvent->getMethod();
if (!$this->methodAnalyser->methodIsEmpty($class, $method)) {
return;
}
$key = $class . '::' . $method;
if (!array_key_exists($key, $this->nullMethods)) {
$this->nullMethods[$key] = array('class' => $class, 'method' => $method, 'expected' => array());
}
$this->nullMethods[$key]['expected'][] = $exception->getExpected();
}