本文整理汇总了PHP中Webmozart\Assert\Assert::null方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::null方法的具体用法?PHP Assert::null怎么用?PHP Assert::null使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Assert\Assert
的用法示例。
在下文中一共展示了Assert::null方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(BankAccountInterface $bankAccount, $specKnown, $specResult)
{
try {
Assert::boolean($specKnown, 'specKnown should be a boolean, got: `%s`');
if (true === $specKnown) {
Assert::boolean($specResult, 'specResult should be a boolean, got: `%s`');
} else {
Assert::null($specResult, 'specResult should be null, got: `%s`');
}
} catch (\InvalidArgumentException $e) {
throw E::wrap($e);
}
$this->bankAccount = $bankAccount;
$this->specKnown = $specKnown;
$this->specResult = $specResult;
}
示例2: promotionShouldNotExistInTheRegistry
/**
* @Then /^(this promotion) should no longer exist in the promotion registry$/
*/
public function promotionShouldNotExistInTheRegistry(PromotionInterface $promotion)
{
Assert::null($this->promotionRepository->findOneBy(['code' => $promotion->getCode()]));
}
示例3: couponShouldNotExistInTheRegistry
/**
* @Then /^(this coupon) should no longer exist in the coupon registry$/
*/
public function couponShouldNotExistInTheRegistry(CouponInterface $coupon)
{
Assert::null($this->couponRepository->findOneBy(['code' => $coupon->getCode()]), sprintf('The coupon with code %s should not exist', $coupon->getCode()));
}
示例4: productVariantShouldNotExistInTheProductCatalog
/**
* @Then this variant should not exist in the product catalog
*/
public function productVariantShouldNotExistInTheProductCatalog()
{
$productVariantId = $this->sharedStorage->get('product_variant_id');
$productVariant = $this->productVariantRepository->find($productVariantId);
Assert::null($productVariant);
}
示例5: orderShouldNotExistInTheRegistry
/**
* @Then this order should not exist in the registry
*/
public function orderShouldNotExistInTheRegistry()
{
$orderId = $this->sharedStorage->get('order_id');
$order = $this->orderRepository->find($orderId);
Assert::null($order);
}
示例6: productVariantShouldNotExistInTheProductCatalog
/**
* @Then /^(this variant) should not exist in the product catalog$/
*/
public function productVariantShouldNotExistInTheProductCatalog(ProductVariantInterface $productVariant)
{
Assert::null($this->productVariantRepository->findOneBy(['code' => $productVariant->getCode()]));
}
示例7: thereIsNoDocumentAt
/**
* @Then there is no :class document at :path
*/
public function thereIsNoDocumentAt($class, $path)
{
$class = 'Symfony\\Cmf\\Bundle\\ResourceRestBundle\\Tests\\Resources\\TestBundle\\Document\\' . $class;
$path = '/tests' . $path;
if (!class_exists($class)) {
throw new \InvalidArgumentException(sprintf('Class "%s" does not exist', $class));
}
$this->session->refresh(true);
$this->manager->clear();
$document = $this->manager->find($class, $path);
Assert::null($document, sprintf('A "%s" document does exist at "%s".', $class, $path));
}
示例8: thisCartShouldBeAutomaticallyDeleted
/**
* @Then /^(this cart) should be automatically deleted$/
*/
public function thisCartShouldBeAutomaticallyDeleted(OrderInterface $cart)
{
$this->expiredCartsRemover->remove();
Assert::null($cart->getId(), 'This cart should not exist in registry but it does.');
}
示例9: orderShouldNotExistInTheRegistry
/**
* @Then /^([^"]+) should not exist in the registry$/
*/
public function orderShouldNotExistInTheRegistry(OrderInterface $order)
{
/** @var OrderInterface $order */
$order = $this->orderRepository->findOneBy(['number' => $order->getNumber()]);
Assert::null($order);
}