當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。