function TermParentsTest::assertParentOption
Same name in other branches
- 9 core/modules/taxonomy/tests/src/Functional/TermParentsTest.php \Drupal\Tests\taxonomy\Functional\TermParentsTest::assertParentOption()
- 10 core/modules/taxonomy/tests/src/Functional/TermParentsTest.php \Drupal\Tests\taxonomy\Functional\TermParentsTest::assertParentOption()
- 11.x core/modules/taxonomy/tests/src/Functional/TermParentsTest.php \Drupal\Tests\taxonomy\Functional\TermParentsTest::assertParentOption()
Asserts that an option in the parent form element of terms exists.
Parameters
string $option: The label of the parent option.
bool $selected: (optional) Whether or not the option should be selected. Defaults to FALSE.
3 calls to TermParentsTest::assertParentOption()
- TermParentsTest::doTestEditingSingleParent in core/
modules/ taxonomy/ tests/ src/ Functional/ TermParentsTest.php - Performs tests that edit terms with a single parent
- TermParentsTest::testEditingParents in core/
modules/ taxonomy/ tests/ src/ Functional/ TermParentsTest.php - Tests editing the parents of existing terms.
- TermParentsTest::testEditingParentsWithDisabledFormElement in core/
modules/ taxonomy/ tests/ src/ Functional/ TermParentsTest.php - Tests specifying parents when creating terms and a disabled parent form.
File
-
core/
modules/ taxonomy/ tests/ src/ Functional/ TermParentsTest.php, line 285
Class
- TermParentsTest
- Tests managing taxonomy parents through the user interface.
Namespace
Drupal\Tests\taxonomy\FunctionalCode
protected function assertParentOption($option, $selected = FALSE) {
$option = $this->assertSession()
->optionExists('Parent terms', $option);
if ($selected) {
$this->assertTrue($option->hasAttribute('selected'));
}
else {
$this->assertFalse($option->hasAttribute('selected'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.