You are here

protected function TableDragTest::assertDraggableTable in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php \Drupal\FunctionalJavascriptTests\TableDrag\TableDragTest::assertDraggableTable()

Asserts the whole structure of the draggable test table.

Parameters

array $structure: The table structure. Each entry represents a row and consists of:

  • id: the expected value for the ID hidden field.
  • weight: the expected row weight.
  • parent: the expected parent ID for the row.
  • indentation: how many indents the row should have.
  • changed: whether or not the row should have been marked as changed.
2 calls to TableDragTest::assertDraggableTable()
TableDragTest::testKeyboardAccessibility in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests accessibility through keyboard of the tabledrag functionality.
TableDragTest::testRootLeafDraggableRowsWithKeyboard in core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php
Tests the root and leaf behaviors for rows.

File

core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.php, line 321

Class

TableDragTest
Tests draggable table.

Namespace

Drupal\FunctionalJavascriptTests\TableDrag

Code

protected function assertDraggableTable(array $structure) {
  $rows = $this
    ->getSession()
    ->getPage()
    ->findAll('xpath', '//table[@id="tabledrag-test-table"]/tbody/tr');
  $this
    ->assertSession()
    ->elementsCount('xpath', '//table[@id="tabledrag-test-table"]/tbody/tr', count($structure));
  foreach ($structure as $delta => $expected) {
    $this
      ->assertTableRow($rows[$delta], $expected['id'], $expected['weight'], $expected['parent'], $expected['indentation'], $expected['changed']);
  }
}