本文整理匯總了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;
}