You are here

public function ConfigurableLanguageUnitTest::testWeight in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php \Drupal\Tests\language\Unit\ConfigurableLanguageUnitTest::testWeight()

@covers ::getWeight @covers ::setWeight

File

core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php, line 40
Contains \Drupal\Tests\language\Unit\ConfigurableLanguageUnitTest.

Class

ConfigurableLanguageUnitTest
Tests the ConfigurableLanguage entity class.

Namespace

Drupal\Tests\language\Unit

Code

public function testWeight() {

  // The weight, an integer. Used to order languages with larger positive
  // weights sinking items toward the bottom of lists.
  $configurableLanguage = new ConfigurableLanguage(array(
    'weight' => -5,
  ), 'configurable_language');
  $this
    ->assertEquals($configurableLanguage
    ->getWeight(), -5);
  $this
    ->assertEquals($configurableLanguage
    ->setWeight(13)
    ->getWeight(), 13);
}