Commit 0b9f1398 authored by catch's avatar catch

Issue #3001619 by Mile23: Fix "AssertLegacyTrait::getAllOptions() is scheduled...

Issue #3001619 by Mile23: Fix "AssertLegacyTrait::getAllOptions() is scheduled for removal in Drupal 9.0.0. Use $element->findAll(\'xpath\', \'option\') instead." deprecation error
parent f159bbd2
......@@ -60,7 +60,7 @@ public function testCommentWizard() {
$fields = $this->xpath($xpath);
$options = [];
foreach ($fields as $field) {
$items = $this->getAllOptions($field);
$items = $field->findAll('xpath', 'option');
foreach ($items as $item) {
$options[] = $item->getValue();
}
......
......@@ -459,9 +459,6 @@ public function testFieldAssertsForOptions() {
$this->pass($e->getMessage());
}
// Test \Drupal\FunctionalTests\AssertLegacyTrait::getAllOptions.
$this->drupalGet('/form-test/select');
$this->assertCount(6, $this->getAllOptions($this->cssSelect('select[name="opt_groups"]')[0]));
}
/**
......
<?php
namespace Drupal\FunctionalTests\Core\Test;
use Drupal\Tests\BrowserTestBase;
/**
* Tests deprecated AssertLegacyTrait functionality.
*
* @group browsertestbase
* @group legacy
*/
class AssertLegacyTraitDeprecatedTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['form_test'];
/**
* Tests getAllOptions().
*
* @expectedDeprecation AssertLegacyTrait::getAllOptions() is scheduled for removal in Drupal 9.0.0. Use $element->findAll('xpath', 'option') instead.
*/
public function testGetAllOptions() {
$this->drupalGet('/form-test/select');
$this->assertCount(6, $this->getAllOptions($this->cssSelect('select[name="opt_groups"]')[0]));
}
}
......@@ -109,7 +109,6 @@ public static function getSkippedDeprecations() {
'The "plugin.manager.migrate.cckfield" service is deprecated. You should use the \'plugin.manager.migrate.field\' service instead. See https://www.drupal.org/node/2751897',
'Drupal\system\Tests\Update\DbUpdatesTrait is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use \Drupal\FunctionalTests\Update\DbUpdatesTrait instead. See https://www.drupal.org/node/2896640.',
'Providing settings under \'handler_settings\' is deprecated and will be removed before 9.0.0. Move the settings in the root of the configuration array. See https://www.drupal.org/node/2870971.',
'AssertLegacyTrait::getAllOptions() is scheduled for removal in Drupal 9.0.0. Use $element->findAll(\'xpath\', \'option\') instead.',
'Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "/system-test/Ȅchȏ/meφΩ/{text}".',
'Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "/somewhere/{item}/over/the/קainbow".',
'Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "/place/meφω".',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment