本文整理汇总了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());
}
示例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);
}
}
示例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);
}
示例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");
}
}
示例5: theOutputShouldContain
/**
* @Given /^the output should contain:$/
*/
public function theOutputShouldContain(PyStringNode $string)
{
foreach ($string->getStrings() as $line) {
\PHPUnit_Framework_Assert::assertContains($line, $this->getOutput());
}
}
示例6: testGetStrings
public function testGetStrings()
{
$str = new PyStringNode(array('line1', 'line2', 'line3'), 0);
$this->assertEquals(array('line1', 'line2', 'line3'), $str->getStrings());
}
示例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));
}
}
示例8: iShouldGet
/**
* @Then I should get:
*/
public function iShouldGet(PyStringNode $string)
{
assertEquals($this->outputLines, $string->getStrings());
}
示例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;
}