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


PHP Assertion::notEq方法代码示例

本文整理汇总了PHP中Assert\Assertion::notEq方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::notEq方法的具体用法?PHP Assertion::notEq怎么用?PHP Assertion::notEq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assert\Assertion的用法示例。


在下文中一共展示了Assertion::notEq方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: allUsersWithAPendingAndOutdatedActivationShouldBeRemoved

 /**
  * @Then All users with a pending and outdated activation should be removed
  */
 public function allUsersWithAPendingAndOutdatedActivationShouldBeRemoved()
 {
     $em = $this->getEntityManager();
     for ($i = 0; $i < 2; ++$i) {
         Assertion::eq(null, $em->getRepository('Account:User')->findOneBy(['username' => (string) $i]));
     }
     Assertion::notEq(null, $em->getRepository('Account:User')->findOneBy(['username' => 'foo']));
 }
开发者ID:thomasmodeneis,项目名称:Sententiaregum,代码行数:11,代码来源:UserPurgerContext.php

示例2: iShouldHaveAnActivationEmail

 /**
  * @Then I should have an activation email
  */
 public function iShouldHaveAnActivationEmail()
 {
     $client = $this->recentClient;
     /** @var \Symfony\Bundle\SwiftMailerBundle\DataCollector\MessageDataCollector $mailCollector */
     $mailCollector = $client->getProfile()->getCollector('swiftmailer');
     Assertion::eq(1, $mailCollector->getMessageCount());
     /** @var \Swift_Message $message */
     $message = $mailCollector->getMessages()[0];
     Assertion::eq($message->getSubject(), 'Sententiaregum Notifications');
     Assertion::eq(key($message->getTo()), 'sententiaregum@sententiaregum.dev');
     $crawler = new Crawler();
     $crawler->addContent($message->getChildren()[1]->getBody());
     Assertion::count($message->getChildren(), 2);
     Assertion::eq(1, $crawler->filter('#n-ac-l-p')->count());
     Assertion::notEq(0, preg_match('/!\\/activate\\/(.*)/', $message->getChildren()[0]->getBody()));
 }
开发者ID:thomasmodeneis,项目名称:Sententiaregum,代码行数:19,代码来源:RegistrationContext.php

示例3: checkEmail

 /**
  * @Then /^I should've gotten an email$/
  */
 public function checkEmail()
 {
     /** @var \Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector $profile */
     $profile = $this->apiContext->getProfile()->getCollector('swiftmailer');
     Assertion::eq(1, $profile->getMessageCount());
     /** @var \Swift_Message $message */
     $message = $profile->getMessages()[0];
     // user registers as "de", so email should be in german
     Assertion::eq($message->getSubject(), 'Benachrichtigungen von Sententiaregum');
     Assertion::eq(key($message->getTo()), 'sententiaregum@sententiaregum.dev');
     $crawler = new Crawler();
     $crawler->addContent($message->getChildren()[1]->getBody());
     Assertion::count($message->getChildren(), 2);
     Assertion::eq(1, $crawler->filter('#n-ac-l-p')->count());
     Assertion::notEq(0, preg_match('/\\/activate\\/(.*)/', $message->getChildren()[0]->getBody()));
 }
开发者ID:sententiaregum,项目名称:sententiaregum,代码行数:19,代码来源:CreateAccountContext.php

示例4: delete

 /**
  * @param string $key
  * @return int
  */
 public function delete($key)
 {
     Assertion::notNull(self::$redis, "Redis connection hasn't been set");
     Assertion::string($key, "Number key must be a string");
     Assertion::notEq($key, "", "Number key must be a non empty string");
     $key = $this->identifier . "::" . $key;
     self::$redis->sRemove($this->identifier, $key);
     self::$redis->delete($key);
     return $this->getCurrentNumber();
 }
开发者ID:3nr1c,项目名称:temporal,代码行数:14,代码来源:Temporal.php


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