Sanpi\Behatch\Context\TableContext::theColumnsSchemaShouldMatch PHP Method

theColumnsSchemaShouldMatch() public method

Checks that the specified table's columns match the given schema
public theColumnsSchemaShouldMatch ( $table, Behat\Gherkin\Node\TableNode $text )
$text Behat\Gherkin\Node\TableNode
    public function theColumnsSchemaShouldMatch($table, TableNode $text)
    {
        $columnsSelector = "{$table} thead tr th";
        $columns = $this->getSession()->getPage()->findAll('css', $columnsSelector);
        $this->iShouldSeeColumnsInTheTable(count($text->getHash()), $table);
        foreach ($text->getHash() as $key => $column) {
            $this->assertEquals($column['columns'], $columns[$key]->getText());
        }
    }