本文整理汇总了PHP中Behat\Gherkin\Node\PyStringNode::addLine方法的典型用法代码示例。如果您正苦于以下问题:PHP PyStringNode::addLine方法的具体用法?PHP PyStringNode::addLine怎么用?PHP PyStringNode::addLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Behat\Gherkin\Node\PyStringNode
的用法示例。
在下文中一共展示了PyStringNode::addLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPyStringFromLinesCreation
public function testPyStringFromLinesCreation()
{
$string = new PyStringNode();
$string->addLine('Hello,');
$string->addLine(' Gherkin');
$string->addLine(' users');
$string->addLine(' =)');
$this->assertEquals(<<<STRING
Hello,
Gherkin
users
=)
STRING
, (string) $string);
}
示例2: testTokens
public function testTokens()
{
$string = new PyStringNode();
$string->addLine('Hello, <username>');
$string->addLine('everything is <status>?');
$string1 = $string->createExampleRowStepArgument(array('username' => 'John', 'status' => 'ok'));
$this->assertNotSame($string, $string1);
$this->assertSame(<<<STRING
Hello, John
everything is ok?
STRING
, (string) $string1);
$string2 = $string->createExampleRowStepArgument(array('username' => 'Mike', 'status' => 'bad'));
$this->assertNotSame($string, $string2);
$this->assertSame(<<<STRING
Hello, Mike
everything is bad?
STRING
, (string) $string2);
}
示例3: parsePyString
/**
* Parses PyString token & returns it's node.
*
* @return Behat\Gherkin\Node\PyStringNode
*/
protected function parsePyString()
{
$token = $this->expectTokenType('PyStringOperator');
$node = new Node\PyStringNode();
while ('PyStringOperator' !== ($predicted = $this->predictTokenType()) && 'Text' === $predicted) {
$node->addLine($this->parseText(false));
}
$this->expectTokenType('PyStringOperator');
$this->skipExtraChars();
return $node;
}