/** * {@inheritdoc} */ public function format($amount, $currency, $locale = 'en') { $formatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY); $result = $formatter->formatCurrency($amount / 100, $currency); Assert::notSame(false, $result, sprintf('The amount "%s" of type %s cannot be formatted to currency "%s".', $amount, gettype($amount), $currency)); return $result; }
/** * @Then /^(the administrator) should know about IP address of (this order made by "[^"]+")$/ */ public function theAdministratorShouldKnowAboutIPAddressOfThisOrderMadeBy(AdminUserInterface $user, OrderInterface $order) { $this->sharedSecurityService->performActionAsAdminUser($user, function () use($order) { $this->showPage->open(['id' => $order->getId()]); Assert::notSame($this->showPage->getIpAddressAssigned(), '', 'There should be IP address assigned to order, but there is not.'); }); }
/** * @Then /^(this order) should not be cancelled$/ */ public function thisOrderShouldNotBeCancelled(OrderInterface $order) { Assert::notSame(OrderInterface::STATE_CANCELLED, $order->getState(), 'Order should not be cancelled, but its is.'); }
/** * @Then I should not see a homepage from :theme theme */ public function iShouldNotSeeThemedHomepage(ThemeInterface $theme) { $content = file_get_contents(rtrim($theme->getPath(), '/') . '/SyliusShopBundle/views/Homepage/index.html.twig'); Assert::notSame($this->homePage->getContents(), $content); }