AssertLegacyTraitDeprecatedTest.php

Same filename and directory in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Core/Test/AssertLegacyTraitDeprecatedTest.php

Namespace

Drupal\FunctionalTests\Core\Test

File

core/tests/Drupal/FunctionalTests/Core/Test/AssertLegacyTraitDeprecatedTest.php

View source
<?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 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
     */
    public function testGetAllOptions() {
        $this->drupalGet('/form-test/select');
        $this->assertCount(6, $this->getAllOptions($this->cssSelect('select[name="opt_groups"]')[0]));
    }

}

Classes

Title Deprecated Summary
AssertLegacyTraitDeprecatedTest Tests deprecated AssertLegacyTrait functionality.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.