Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertShippingMethodOnPrintOrder.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Sales\Test\Page\SalesGuestPrint;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertShippingMethodOnPrintOrder extends AbstractConstraint
16 {
20  const SHIPPING_TEMPLATE = "%s - %s";
21 
29  public function processAssert(SalesGuestPrint $salesGuestPrint, $shipping)
30  {
31  $expected = sprintf(self::SHIPPING_TEMPLATE, $shipping['shipping_service'], $shipping['shipping_method']);
32  \PHPUnit\Framework\Assert::assertTrue(
33  $salesGuestPrint->getInfoShipping()->isShippingMethodVisible($expected),
34  "Shipping method was printed incorrectly."
35  );
36  }
37 
43  public function toString()
44  {
45  return "Shipping method was printed correctly.";
46  }
47 }