当前位置: 首页>>代码示例>>PHP>>正文


PHP TableNode::getColumn方法代码示例

本文整理汇总了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));
 }
开发者ID:higrow,项目名称:Gherkin,代码行数:8,代码来源:TableNodeTest.php

示例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.");
         }
     }
 }
开发者ID:ec-europa,项目名称:platform-dev,代码行数:20,代码来源:MinkContext.php

示例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));
         }
     }
 }
开发者ID:stephenharris,项目名称:WordPressBehatExtension,代码行数:23,代码来源:WordPressAdminContext.php

示例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 ');
     }
 }
开发者ID:old-town,项目名称:workflow-zf2-service,代码行数:32,代码来源:ServiceContext.php


注:本文中的Behat\Gherkin\Node\TableNode::getColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。