/** * Helper method checks the order number * @param AccountOrder $order * @param string $orderNumber */ private function checkOrderNumber(AccountOrder $order, $orderNumber) { $properties = array('number' => $orderNumber); $result = Helper::assertElementProperties($order, $properties); if ($result === true) { return; } $message = sprintf('The order number is "%s" (should be "%s")', $result['value'], $result['value2']); Helper::throwException($message); }
/** * Checks an emotion article element * @param Article $article * @param array $data */ public function checkArticle(Article $article, array $data) { $properties = Helper::convertTableHashToArray($data); $properties = Helper::floatArray($properties, ['price']); $result = Helper::assertElementProperties($article, $properties); if ($result === true) { return; } $message = sprintf('The article %s is "%s" (should be "%s")', $result['key'], $result['value'], $result['value2']); Helper::throwException($message); }
/** * @param string $paymentMethod * @throws \Behat\Behat\Exception\PendingException * @throws \Exception */ public function checkPaymentMethod($paymentMethod) { /** @var CheckoutPayment $element */ $element = $this->getElement('CheckoutPayment'); $properties = array('paymentMethod' => $paymentMethod); $result = Helper::assertElementProperties($element, $properties); if ($result === true) { return; } $message = sprintf('The current payment method is "%s" (should be "%s")', $result['value'], $result['value2']); Helper::throwException($message); }