Ejemplo n.º 1
0
 public function __construct($title, $value1, $value2, $expected, $precision = 0.0001)
 {
     $result = $this->compare($value1, $value2, $precision);
     echo "\n\n{$title} ";
     echo ": " . ($result->getMatched() ? 'matched' : 'failed');
     if ($result->getMatched() !== $expected) {
         echo " ******* UNEXPECTED RESULT ******\n";
     } else {
         echo "\n";
     }
     $this->visitor = new FormattingVisitor($result, 'Original', 'Comparison');
     $result->accept($this->visitor);
     echo $this->visitor->getOutput();
     $this->showBehatTableQuickFix($value2);
     $this->expected = $expected;
 }
Ejemplo n.º 2
0
 /**
  * @param $result
  * @return FormattingVisitor
  */
 public function innerVisit($result)
 {
     $visitor = new FormattingVisitor($result);
     $visitor->setWidthsFrom($this);
     return $visitor;
 }