function TokenTest::testScanDeprecation

Tests passing a non-string value to Token::scan().

@group legacy

File

core/tests/Drupal/Tests/Core/Utility/TokenTest.php, line 339

Class

TokenTest
@coversDefaultClass \Drupal\Core\Utility\Token @group Utility

Namespace

Drupal\Tests\Core\Utility

Code

public function testScanDeprecation() : void {
    $this->expectDeprecation('Calling Drupal\\Core\\Utility\\Token::scan() with a $text parameter of type other than string is deprecated in drupal:10.1.0 and will cause an error in drupal:11.0.0. See https://www.drupal.org/node/3334317');
    $this->assertSame([], $this->token
        ->scan(NULL));
}

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