当前位置: 首页>>代码示例>>PHP>>正文


PHP Assert::null方法代码示例

本文整理汇总了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;
 }
开发者ID:cs278,项目名称:bank-modulus,代码行数:16,代码来源:Result.php

示例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()]));
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:7,代码来源:ManagingPromotionsContext.php

示例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()));
 }
开发者ID:TeamNovatek,项目名称:Sylius,代码行数:7,代码来源:PromotionCouponContext.php

示例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);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:9,代码来源:ManagingProductsContext.php

示例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);
 }
开发者ID:gabiudrescu,项目名称:Sylius,代码行数:9,代码来源:ManagingOrdersContext.php

示例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()]));
 }
开发者ID:loic425,项目名称:Sylius,代码行数:7,代码来源:ManagingProductsContext.php

示例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));
 }
开发者ID:symfony-cmf,项目名称:resource-rest-bundle,代码行数:15,代码来源:ResourceContext.php

示例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.');
 }
开发者ID:loic425,项目名称:Sylius,代码行数:8,代码来源:CartContext.php

示例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);
 }
开发者ID:TeamNovatek,项目名称:Sylius,代码行数:9,代码来源:OrderContext.php


注:本文中的Webmozart\Assert\Assert::null方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。