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