本文整理汇总了PHP中Behat\Gherkin\Node\TableNode::getRowAsString方法的典型用法代码示例。如果您正苦于以下问题:PHP TableNode::getRowAsString方法的具体用法?PHP TableNode::getRowAsString怎么用?PHP TableNode::getRowAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Behat\Gherkin\Node\TableNode
的用法示例。
在下文中一共展示了TableNode::getRowAsString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printOutlineExampleResult
/**
* Prints outline example result.
*
* @param TableNode $examples examples table
* @param integer $iteration example row
* @param integer $result result code
* @param boolean $isSkipped is outline example skipped
*
* @uses printColorizedTableRow()
* @uses printOutlineExampleResultExceptions()
*/
protected function printOutlineExampleResult(TableNode $examples, $iteration, $result, $isSkipped)
{
if (!$this->getParameter('expand')) {
$color = $this->getResultColorCode($result);
$this->printColorizedTableRow($examples->getRowAsString($iteration + 1), $color);
$this->printOutlineExampleResultExceptions($examples, $this->delayedStepEvents);
} else {
$this->write(' ' . $examples->getKeyword() . ': ');
$this->writeln('| ' . implode(' | ', $examples->getRow($iteration + 1)) . ' |');
$this->stepIndent = ' ';
foreach ($this->delayedStepEvents as $event) {
$this->printStep($event->getStep(), $event->getResult(), $event->getDefinition(), $event->getSnippet(), $event->getException());
}
$this->stepIndent = ' ';
if ($iteration < count($examples->getRows()) - 2) {
$this->writeln();
}
}
}
示例2: testGetRowAsString
public function testGetRowAsString()
{
$table = new TableNode(array(5 => array('username', 'password'), 10 => array('everzet', 'qwerty'), 13 => array('antono', 'pa$sword')));
$this->assertEquals('| username | password |', $table->getRowAsString(0));
$this->assertEquals('| antono | pa$sword |', $table->getRowAsString(2));
}
示例3: dumpTableNode
/**
* Dumps table node.
*
* @param TableNode $tableNode Table node
* @param integer $indent Indentation
* @return string
*/
public function dumpTableNode(TableNode $tableNode, $indent = 0)
{
$len = sizeof($tableNode->getRows());
$content = '';
for ($i = 0; $i < $len; $i++) {
$content .= PHP_EOL . $this->dumpIndent($indent) . $tableNode->getRowAsString($i);
}
return $content;
}
示例4: printOutlineExampleResult
/**
* Prints outline example result.
*
* @param Behat\Gherkin\Node\TableNode $examples examples table
* @param integer $iteration example row
* @param integer $result result code
* @param boolean $isSkipped is outline example skipped
*
* @uses printColorizedTableRow()
* @uses printOutlineExampleResultExceptions()
*/
protected function printOutlineExampleResult(TableNode $examples, $iteration, $result, $isSkipped)
{
$color = $this->getResultColorCode($result);
$this->printColorizedTableRow($examples->getRowAsString($iteration + 1), $color);
$this->printOutlineExampleResultExceptions($examples, $this->delayedStepEvents);
}