function ArgumentNodeRevisionIdTest::testVidDeprecatedParameter

Tests the Vid argument deprecation.

@group legacy

File

core/modules/node/tests/src/Kernel/Views/ArgumentNodeRevisionIdTest.php, line 66

Class

ArgumentNodeRevisionIdTest
Tests the node_vid handler.

Namespace

Drupal\Tests\node\Kernel\Views

Code

public function testVidDeprecatedParameter() {
    $this->expectDeprecation('Passing the database service to Drupal\\node\\Plugin\\views\\argument\\Vid::__construct() is deprecated in drupal:9.2.0 and will be removed before drupal:10.0.0. See https://www.drupal.org/node/3178412');
    $database = $this->container
        ->get('database');
    $node_storage = $this->container
        ->get('entity_type.manager')
        ->getStorage('node');
    $vid = new Vid([], 'test_plugin', [], $database, $node_storage);
    $this->assertNotNull($vid);
}

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