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


PHP PyStringNode::getStrings方法代码示例

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


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

示例1: iShouldSee

 /**
  * @Then I should see:
  */
 public function iShouldSee(PyStringNode $content)
 {
     $displayArray = explode("\n", $this->tester->getDisplay());
     array_walk($displayArray, function (&$line) {
         $line = rtrim($line);
     });
     expect($displayArray)->shouldBeLike($content->getStrings());
 }
开发者ID:phpzone,项目名称:shell,代码行数:11,代码来源:ApplicationContext.php

示例2: theConsoleOutputShouldHaveLinesEndingIn

 /**
  * @Then /^the console output should have lines ending in:$/
  */
 public function theConsoleOutputShouldHaveLinesEndingIn(PyStringNode $string)
 {
     $stdOutLines = explode(PHP_EOL, $this->lastBehatStdOut);
     $expectedLines = $string->getStrings();
     \PHPUnit_Framework_Assert::assertCount(count($expectedLines), $stdOutLines);
     foreach ($stdOutLines as $idx => $stdOutLine) {
         $suffix = isset($expectedLines[$idx]) ? $expectedLines[$idx] : '(NONE)';
         $constraint = \PHPUnit_Framework_Assert::stringEndsWith($suffix);
         $constraint->evaluate($stdOutLine);
     }
 }
开发者ID:rbaarsma,项目名称:fastest,代码行数:14,代码来源:FeatureContext.php

示例3: iExpectTheFollowingEvents

 /**
  * Expect until all of the named events have been fired.
  *
  * @Then I expect the following events:
  */
 public function iExpectTheFollowingEvents(PyStringNode $eventNames)
 {
     $this->waitForAuraEvents($eventNames->getStrings(), 5000);
 }
开发者ID:jimblizz,项目名称:sulu,代码行数:9,代码来源:AdminContext.php

示例4: outputShouldNotBe

 /**
  * @Given output should not be:
  */
 public function outputShouldNotBe(PyStringNode $string)
 {
     $expected = $string->getStrings();
     $check = false;
     foreach ($this->output as $index => $line) {
         if ($line !== $expected[$index]) {
             $check = true;
             break;
         }
     }
     if ($check === false) {
         throw new \Exception("Output should not be");
     }
 }
开发者ID:behatch,项目名称:contexts,代码行数:17,代码来源:SystemContext.php

示例5: theOutputShouldContain

 /**
  * @Given /^the output should contain:$/
  */
 public function theOutputShouldContain(PyStringNode $string)
 {
     foreach ($string->getStrings() as $line) {
         \PHPUnit_Framework_Assert::assertContains($line, $this->getOutput());
     }
 }
开发者ID:hason,项目名称:phpcr-shell,代码行数:9,代码来源:ContextBase.php

示例6: testGetStrings

 public function testGetStrings()
 {
     $str = new PyStringNode(array('line1', 'line2', 'line3'), 0);
     $this->assertEquals(array('line1', 'line2', 'line3'), $str->getStrings());
 }
开发者ID:higrow,项目名称:Gherkin,代码行数:5,代码来源:PyStringNodeTest.php

示例7: theHeadersContain

 /**
  * @Then the headers contain
  */
 public function theHeadersContain(PyStringNode $string)
 {
     $response = $this->getClient()->getResponse();
     foreach ($string->getStrings() as $header) {
         list($name, $value) = preg_split('/\\s*:\\s*/', $header, 2);
         \assertTrue($response->headers->has($name));
         \assertEquals($value, $response->headers->get($name));
     }
 }
开发者ID:mbfisher,项目名称:web-test,代码行数:12,代码来源:ApplicationFeatureContext.php

示例8: iShouldGet

 /**
  * @Then I should get:
  */
 public function iShouldGet(PyStringNode $string)
 {
     assertEquals($this->outputLines, $string->getStrings());
 }
开发者ID:real34,项目名称:test-mink,代码行数:7,代码来源:FeatureContext.php

示例9: parseOptions

 /**
  * @param PyStringNode $options
  *
  * @return array
  */
 private function parseOptions(PyStringNode $options)
 {
     $return = array();
     foreach ($options->getStrings() as $option) {
         if (preg_match('/(?P<option>\\-\\-[a-zA-Z0-9\\-]*)((\\=|\\s)(?P<value>[^\\n\\s]*))?/', $option, $matches)) {
             $return[$matches['option']] = isset($matches['value']) ? $matches['value'] : true;
         }
         if (preg_match('/(?P<option>\\-[a-zA-Z0-9\\-]*) (?P<value>[^\\n\\s]*)?/', $option, $matches)) {
             $return[$matches['option']] = isset($matches['value']) ? $matches['value'] : true;
         }
     }
     return $return;
 }
开发者ID:Hexmedia,项目名称:Crontab,代码行数:18,代码来源:ApplicationContext.php


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