Commit 0e77ecba authored by Valentin Sushkov's avatar Valentin Sushkov

Fixed constraint evaluation

parent 923ba924
......@@ -149,12 +149,29 @@ abstract class EcomDev_PHPUnit_Constraint_Abstract
/**
* Evaluates value by type.
* (non-PHPdoc)
*
* @see PHPUnit_Framework_Constraint::evaluate()
*
* @param mixed $other Value or object to evaluate.
* @param string $description Additional information about the test
* @param bool $returnResult Whether to return a result or throw an exception
* @return mixed
*/
public function evaluate($other)
public function evaluate($other, $description = '', $returnResult = false)
{
return $this->callProtectedByType('evaluate', $other);
$success = false;
if ($this->callProtectedByType('evaluate', $other)) {
$success = true;
}
if ($returnResult) {
return $success;
}
if (!$success) {
$this->fail($other, $description);
}
}
/**
......@@ -215,4 +232,4 @@ abstract class EcomDev_PHPUnit_Constraint_Abstract
{
return $this->callProtectedByType('text');
}
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment