function DisplayVariantTest::testGetWeight

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::testGetWeight()
  2. 8.9.x core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::testGetWeight()
  3. 10 core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php \Drupal\Tests\Core\Display\DisplayVariantTest::testGetWeight()

Tests the getWeight() method.

@covers ::getWeight

File

core/tests/Drupal/Tests/Core/Display/DisplayVariantTest.php, line 59

Class

DisplayVariantTest
@coversDefaultClass \Drupal\Core\Display\VariantBase @group Display

Namespace

Drupal\Tests\Core\Display

Code

public function testGetWeight() : void {
    $display_variant = $this->setUpDisplayVariant([
        'weight' => 5,
    ]);
    $this->assertSame(5, $display_variant->getWeight());
}

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