Esempio n. 1
0
 /**
  * Override to run attached constraint if available
  *
  * @return mixed
  * @throws \PHPUnit_Framework_Exception
  */
 protected function runTest()
 {
     if (isset($this->currentVariation['arguments']['issue']) && !empty($this->currentVariation['arguments']['issue'])) {
         $this->markTestIncomplete($this->currentVariation['arguments']['issue']);
     }
     $testResult = parent::runTest();
     $this->localArguments = array_merge($this->localArguments, is_array($testResult) ? $testResult : []);
     $arguments = array_merge($this->currentVariation['arguments'], $this->localArguments);
     if ($this->constraint) {
         $this->constraint->configure($arguments);
         self::assertThat($this->getName(), $this->constraint);
     }
     return $testResult;
 }
 /**
  * Perform assert
  *
  * @param AbstractConstraint $assert
  * @param InjectableFixture $product
  * @return void
  */
 protected function productCompareAssert(AbstractConstraint $assert, InjectableFixture $product)
 {
     $assert->configure($this, ['catalogProductView' => $this->catalogProductView, 'product' => $product]);
     \PHPUnit_Framework_Assert::assertThat($this->getName(), $assert);
 }