class AssertLegacyTraitDeprecatedTest
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/FunctionalTests/Core/Test/AssertLegacyTraitDeprecatedTest.php \Drupal\FunctionalTests\Core\Test\AssertLegacyTraitDeprecatedTest
Tests deprecated AssertLegacyTrait functionality.
@group browsertestbase @group legacy
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Core\Test\AssertLegacyTraitDeprecatedTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of AssertLegacyTraitDeprecatedTest
File
-
core/
tests/ Drupal/ FunctionalTests/ Core/ Test/ AssertLegacyTraitDeprecatedTest.php, line 13
Namespace
Drupal\FunctionalTests\Core\TestView source
class AssertLegacyTraitDeprecatedTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'form_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests getAllOptions().
*/
public function testGetAllOptions() {
$this->expectDeprecation('AssertLegacyTrait::getAllOptions() is deprecated in drupal:8.5.0 and is removed from drupal:10.0.0. Use $element->findAll(\'xpath\', \'option\') instead. See https://www.drupal.org/node/3129738');
$this->drupalGet('/form-test/select');
$this->assertCount(6, $this->getAllOptions($this->cssSelect('select[name="opt_groups"]')[0]));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.