assertTableRow example


  protected function assertDraggableTable(array $structure, string $table_id = 'tabledrag-test-table', bool $skip_missing = FALSE): void {
    $rows = $this->getSession()->getPage()->findAll('xpath', "//table[@id='$table_id']/tbody/tr");
    $this->assertSession()->elementsCount('xpath', "//table[@id='$table_id']/tbody/tr", count($structure));

    foreach ($structure as $delta => $expected) {
      $this->assertTableRow($rows[$delta]$expected['id']$expected['weight']$expected['parent']$expected['indentation']$expected['changed']$skip_missing);
    }
  }

  /** * Asserts the values of a draggable row. * * @param \Behat\Mink\Element\NodeElement $row * The row element to assert. * @param string $id * The expected value for the ID hidden input of the row. * @param int $weight * The expected weight of the row. * @param string $parent * The expected parent ID. * @param int $indentation * The expected indentation of the row. * @param bool|null $changed * Whether or not the row should have been marked as changed. NULL means * that this assertion should be skipped. * @param bool $skip_missing * Whether assertions done on missing elements value may be skipped or not. * Defaults to FALSE. * * @internal */
Home | Imprint | This part of the site doesn't use cookies.