private function getViewComparingCallback(View $expectedView)
{
return function ($value) use($expectedView) {
if (!$value instanceof View) {
return false;
}
// Need to unwrap phpspec's Collaborators to ensure proper comparison.
$this->unwrapViewData($expectedView);
$this->nullifyDates($value);
$this->nullifyDates($expectedView);
return $expectedView->getStatusCode() === $value->getStatusCode() && $expectedView->getHeaders() === $value->getHeaders() && $expectedView->getEngine() === $value->getEngine() && $expectedView->getFormat() === $value->getFormat() && $expectedView->getData() === $value->getData() && $expectedView->getTemplate() === $value->getTemplate() && $expectedView->getTemplateVar() === $value->getTemplateVar();
};
}