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'.");
        }
    }