本文整理汇总了PHP中Webmozart\Assert\Assert::notSame方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::notSame方法的具体用法?PHP Assert::notSame怎么用?PHP Assert::notSame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Assert\Assert
的用法示例。
在下文中一共展示了Assert::notSame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: format
/**
* {@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;
}
示例2: theAdministratorShouldKnowAboutIPAddressOfThisOrderMadeBy
/**
* @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.');
});
}
示例3: thisOrderShouldNotBeCancelled
/**
* @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.');
}
示例4: iShouldNotSeeThemedHomepage
/**
* @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);
}