ConfigurableLanguageUnitTest.php in Zircon Profile 8.0
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(array(
'direction' => ConfigurableLanguage::DIRECTION_LTR,
), 'configurable_language');
$this
->assertEquals(ConfigurableLanguage::DIRECTION_LTR, $configurableLanguage
->getDirection());
$configurableLanguage = new ConfigurableLanguage(array(
'direction' => ConfigurableLanguage::DIRECTION_RTL,
), 'configurable_language');
$this
->assertEquals(ConfigurableLanguage::DIRECTION_RTL, $configurableLanguage
->getDirection());
}
public function testWeight() {
$configurableLanguage = new ConfigurableLanguage(array(
'weight' => -5,
), 'configurable_language');
$this
->assertEquals($configurableLanguage
->getWeight(), -5);
$this
->assertEquals($configurableLanguage
->setWeight(13)
->getWeight(), 13);
}
}