本文整理汇总了PHP中Behat\Gherkin\Node\TableNode::getColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP TableNode::getColumn方法的具体用法?PHP TableNode::getColumn怎么用?PHP TableNode::getColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Behat\Gherkin\Node\TableNode
的用法示例。
在下文中一共展示了TableNode::getColumn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetColumn
public function testGetColumn()
{
$table = new TableNode(array(array('username', 'password'), array('everzet', 'qwerty'), array('antono', 'pa$sword')));
$this->assertEquals(array('username', 'everzet', 'antono'), $table->getColumn(0));
$this->assertEquals(array('password', 'qwerty', 'pa$sword'), $table->getColumn(1));
$table = new TableNode(array(array('username'), array('everzet'), array('antono')));
$this->assertEquals(array('username', 'everzet', 'antono'), $table->getColumn(0));
}
示例2: assertFilesDownloadable
/**
* Checks that the given list of files return a 200 OK status code.
*
* @param \Behat\Gherkin\Node\TableNode $files
* The list of files that should be downloadable, relative to the base URL.
*
* @throws \Behat\Mink\Exception\ExpectationException
* Thrown when a file could not be downloaded.
*
* @Then the following files can be downloaded:
*/
public function assertFilesDownloadable(TableNode $files)
{
$client = new Client();
foreach ($files->getColumn(0) as $file) {
if ($client->head($this->locatePath($file))->getStatusCode() != 200) {
throw new ExpectationException("File {$file} could not be downloaded.");
}
}
}
示例3: theAdminMenuShouldAppearAs
/**
* @Then the admin menu should appear as
*/
public function theAdminMenuShouldAppearAs(TableNode $table)
{
$adminMenu = $this->adminPage->getMenu();
$topLevel = $adminMenu->getTopLevelMenuItems();
$actualHash = array();
foreach ($topLevel as $actualMenuName) {
$actualHash[] = array($actualMenuName);
}
$actualTableNode = new TableNode($actualHash);
if (count($topLevel) != count($table->getRows())) {
throw new \Exception("Number of rows do not match. Found: \n" . $actualTableNode);
}
$expected = $table->getColumn(0);
foreach ($topLevel as $index => $actualMenuName) {
$expectedMenuName = $expected[$index];
if (!preg_match("/{$expectedMenuName}/", $actualMenuName)) {
throw new \Exception(sprintf('Expected "%s" but found "%s":' . "\n" . $actualTableNode, $expectedMenuName, $actualMenuName));
}
}
}
示例4: validateCurrentSteps
/**
* @Then Process of workflow with the alias :entryAlias has the below steps:
*
* @param string $entryAlias
* @param TableNode $steps
*
* @throws \RuntimeException
*/
public function validateCurrentSteps($entryAlias, TableNode $steps)
{
$entryId = $this->getEntryIdByAlias($entryAlias);
$currentSteps = $this->getWorkflowManager()->getConfiguration()->getWorkflowStore()->findCurrentSteps($entryId);
$actualCurrentSteps = [];
foreach ($currentSteps as $currentStep) {
$actualCurrentSteps[(int) $currentStep->getStepId()] = $currentStep;
}
$stepsColumn = $steps->getColumn(0);
if (count($stepsColumn) < 2 || 'stepId' !== array_shift($stepsColumn)) {
$errMsg = 'Incorrect step id list';
throw new \RuntimeException($errMsg);
}
foreach ($stepsColumn as $currentStepFromColumn) {
$currentStepFromColumn = (int) $currentStepFromColumn;
if (!array_key_exists($currentStepFromColumn, $actualCurrentSteps)) {
$errMsg = sprintf('Step not found %s', $currentStepFromColumn);
throw new \RuntimeException($errMsg);
}
}
if (count($actualCurrentSteps) !== count($stepsColumn)) {
throw new \RuntimeException('there are extra currentSteps ');
}
}