Example #1
0
 protected function assertResult($result)
 {
     assertThat($result, logicalOr(matchesRegularExpression(self::$RESULT_SUCCESS_RE), isNull()));
 }
 public function testLogicalOr()
 {
     $expected = $this->logicalOr($this->isTrue(), $this->isFalse());
     $actual = logicalOr($this->isTrue(), $this->isFalse());
     $this->assertSame($expected->toString(), $actual->toString());
 }
 /**
  * @param string    $attribute
  * @param string    $products
  * @param TableNode $table
  *
  * @Given /^the prices "([^"]*)" of products? (.*) should be:$/
  */
 public function thePricesOfProductsShouldBe($attribute, $products, TableNode $table)
 {
     $this->clearUOW();
     foreach ($this->listToArray($products) as $identifier) {
         $productValue = $this->getProductValue($identifier, strtolower($attribute));
         foreach ($table->getHash() as $price) {
             $productPrice = $productValue->getPrice($price['currency']);
             if ('' === trim($price['amount'])) {
                 assertThat(null, logicalOr($productPrice, $productPrice->getData()));
             } else {
                 assertEquals($price['amount'], $productPrice->getData());
             }
         }
     }
 }