ConfigurableLanguageUnitTest.php in Drupal 8
File
core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php
View source
<?php
namespace Drupal\Tests\language\Unit;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\Tests\UnitTestCase;
class ConfigurableLanguageUnitTest extends UnitTestCase {
public function testDirection() {
$configurableLanguage = new ConfigurableLanguage([
'direction' => ConfigurableLanguage::DIRECTION_LTR,
], 'configurable_language');
$this
->assertEquals(ConfigurableLanguage::DIRECTION_LTR, $configurableLanguage
->getDirection());
$configurableLanguage = new ConfigurableLanguage([
'direction' => ConfigurableLanguage::DIRECTION_RTL,
], 'configurable_language');
$this
->assertEquals(ConfigurableLanguage::DIRECTION_RTL, $configurableLanguage
->getDirection());
}
public function testWeight() {
$configurableLanguage = new ConfigurableLanguage([
'weight' => -5,
], 'configurable_language');
$this
->assertEquals($configurableLanguage
->getWeight(), -5);
$this
->assertEquals($configurableLanguage
->setWeight(13)
->getWeight(), 13);
}
}