protected function assertValidMessageTable(TableNode $messages, $expected_header)
    {
        // Check that the table only contains a single column.
        $header_row = $messages->getRow(0);

        $column_count = count($header_row);
        if ($column_count != 1) {
            throw new \RuntimeException("The list of $expected_header should only contain 1 column. It has $column_count columns.");
        }

        // Check that the correct header is used.
        $actual_header = reset($header_row);
        if (strtolower(trim($actual_header)) !== $expected_header) {
            $capitalized_header = ucfirst($expected_header);
            throw new \RuntimeException("The list of $expected_header should have the header '$capitalized_header'.");
        }
    }
protected function assertValidMessageTable(TableNode $messages, $expected_header)
    {
        // Check that the table only contains a single column.
        $header_row = $messages->getRow(0);

        $column_count = count($header_row);
        if ($column_count != 1) {
            throw new \RuntimeException("The list of $expected_header should only contain 1 column. It has $column_count columns.");
        }

        // Check that the correct header is used.
        $actual_header = reset($header_row);
        if (strtolower(trim($actual_header)) !== $expected_header) {
            $capitalized_header = ucfirst($expected_header);
            throw new \RuntimeException("The list of $expected_header should have the header '$capitalized_header'.");
        }
    }
protected function assertValidMessageTable ( TableNode $ messages , $ expected_header ) { // Check that the table only contains a single column. $ header_row = $ messages -> getRow ( 0 ) ; $ column_count = count ( $ header_row ) ; if ( $ column_count != 1 ) { throw new \ RuntimeException ( "The list of $expected_header should only contain 1 column. It has $column_count columns." ) ; } // Check that the correct header is used. $ actual_header = reset ( $ header_row ) ; if ( strtolower ( trim ( $ actual_header ) ) !== $ expected_header ) { $ capitalized_header = ucfirst ( $ expected_header ) ; throw new \ RuntimeException ( "The list of $expected_header should have the header '$capitalized_header'." ) ; } }
Checks whether the given list of messages is valid.

This checks whether the list has only one column and has the correct
header.

@param \Behat\Gherkin\Node\TableNode $messages
The list of messages.
@param string $expected_header
The header that should be present in the list.
Checks whether the given list of messages is valid .