AssertLegacyTraitDeprecatedTest.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Core/Test/AssertLegacyTraitDeprecatedTest.php
View source
<?php
namespace Drupal\FunctionalTests\Core\Test;
use Drupal\Tests\BrowserTestBase;
class AssertLegacyTraitDeprecatedTest extends BrowserTestBase {
protected static $modules = [
'form_test',
];
protected $defaultTheme = 'stark';
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]));
}
}