/** * Assert that products printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint * @param InjectableFixture[] $products * @return void */ public function processAssert(SalesGuestPrint $salesGuestPrint, array $products) { $errors = ''; foreach ($products as $product) { if (!$salesGuestPrint->getViewBlock()->getItemBlock()->isItemVisible($product)) { $errors .= sprintf(self::ERROR_MESSAGE, $product->getName()); } } \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); }
/** * Assert that payment method was printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint * @param string $paymentMethod * @return void */ public function processAssert(SalesGuestPrint $salesGuestPrint, $paymentMethod) { \PHPUnit_Framework_Assert::assertTrue($salesGuestPrint->getInfoBlock()->isPaymentMethodVisible($paymentMethod), "Payment method was printed incorrect on sales guest print page."); }
/** * Assert that shipping method was printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint * @param array $shipping * @return void */ public function processAssert(SalesGuestPrint $salesGuestPrint, $shipping) { $expected = sprintf(self::SHIPPING_TEMPLATE, $shipping['shipping_service'], $shipping['shipping_method']); \PHPUnit_Framework_Assert::assertTrue($salesGuestPrint->getInfoShipping()->isShippingMethodVisible($expected), "Shipping method was printed incorrectly."); }
/** * Assert that Grand Total price was printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint * @param array $prices * @return void */ public function processAssert(SalesGuestPrint $salesGuestPrint, array $prices) { \PHPUnit_Framework_Assert::assertEquals(number_format(array_sum($prices), 2), $salesGuestPrint->getViewBlock()->getItemBlock()->getGrandTotal(), "Grand total was printed incorrectly."); }
/** * Assert that sales rule amount printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint * @param string $salesRuleDiscount * @return void */ public function processAssert(SalesGuestPrint $salesGuestPrint, $salesRuleDiscount) { \PHPUnit_Framework_Assert::assertEquals($salesRuleDiscount, $salesGuestPrint->getViewSalesRule()->getItemBlock()->getSalesRuleDiscount(), "Sales rule amount not equals."); }
/** * Assert that BillingAddress printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint * @param Address $billingAddress * @return void */ public function processAssert(SalesGuestPrint $salesGuestPrint, Address $billingAddress) { $addressRenderer = $this->objectManager->create('Magento\\Customer\\Test\\Block\\Address\\Renderer', ['address' => $billingAddress, 'type' => 'html']); $expectedBillingAddress = $addressRenderer->render(); \PHPUnit_Framework_Assert::assertEquals($expectedBillingAddress, $salesGuestPrint->getInfoBlock()->getBillingAddress(), "Billing address was printed incorrectly."); }
/** * Assert that Grand Total price was printed correctly on sales guest print page. * * @param SalesGuestPrint $salesGuestPrint * @param string $grandTotal * @return void */ public function processAssert(SalesGuestPrint $salesGuestPrint, $grandTotal) { \PHPUnit_Framework_Assert::assertEquals($grandTotal, $salesGuestPrint->getViewBlock()->getItemBlock()->getGrandTotal(), "Grand total was printed incorrectly."); }