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


PHP Assert::contains方法代码示例

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


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

示例1: makeRelative

 /**
  * Turns a URL into a relative path.
  *
  * The result is a canonical path. This class is using functionality of Path class.
  *
  * @see Path
  *
  * @param string $url     A URL to make relative.
  * @param string $baseUrl A base URL.
  *
  * @return string
  *
  * @throws InvalidArgumentException If the URL and base URL does
  *                                  not match.
  */
 public static function makeRelative($url, $baseUrl)
 {
     Assert::string($url, 'The URL must be a string. Got: %s');
     Assert::string($baseUrl, 'The base URL must be a string. Got: %s');
     Assert::contains($baseUrl, '://', '%s is not an absolute Url.');
     list($baseHost, $basePath) = self::split($baseUrl);
     if (false === strpos($url, '://')) {
         if (0 === strpos($url, '/')) {
             $host = $baseHost;
         } else {
             $host = '';
         }
         $path = $url;
     } else {
         list($host, $path) = self::split($url);
     }
     if ('' !== $host && $host !== $baseHost) {
         throw new InvalidArgumentException(sprintf('The URL "%s" cannot be made relative to "%s" since their host names are different.', $host, $baseHost));
     }
     return Path::makeRelative($path, $basePath);
 }
开发者ID:webmozart,项目名称:path-util,代码行数:36,代码来源:Url.php

示例2: iShouldSeeOutput

 /**
  * @Then I should see output :text
  */
 public function iShouldSeeOutput($text)
 {
     Assert::contains($this->tester->getDisplay(), $text);
 }
开发者ID:sylius,项目名称:sylius,代码行数:7,代码来源:InstallerContext.php

示例3: theyShouldHaveOrderLikeAnd

 /**
  * @Then they should have order like :firstTaxonName, :secondTaxonName, :thirdTaxonName and :fourthTaxonName
  */
 public function theyShouldHaveOrderLikeAnd(...$taxonsNames)
 {
     $leaves = $this->createPage->getLeaves();
     foreach ($leaves as $key => $leaf) {
         Assert::contains($taxonsNames[$key], $leaf->getText());
     }
 }
开发者ID:loic425,项目名称:Sylius,代码行数:10,代码来源:ManagingTaxonsContext.php

示例4: assertPageHasContent

 /**
  * {@inheritdoc}
  */
 public function assertPageHasContent(StaticContent $staticContent)
 {
     $this->verify(['name' => $staticContent->getName()]);
     Assert::contains($this->getSession()->getPage()->getHtml(), $staticContent->getTitle());
     Assert::contains($this->getSession()->getPage()->getHtml(), $staticContent->getBody());
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:9,代码来源:StaticContentPage.php

示例5: iShouldSeeThatImpersonatingWasSuccessful

 /**
  * @Then I should see that impersonating :email was successful
  */
 public function iShouldSeeThatImpersonatingWasSuccessful($email)
 {
     Assert::contains($this->customerShowPage->getSuccessFlashMessage(), $email);
 }
开发者ID:sylius,项目名称:sylius,代码行数:7,代码来源:ImpersonatingCustomersContext.php


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