public function ConfigurableLanguageUnitTest::testDirection in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php \Drupal\Tests\language\Unit\ConfigurableLanguageUnitTest::testDirection()
@covers ::getDirection
File
- core/
modules/ language/ tests/ src/ Unit/ ConfigurableLanguageUnitTest.php, line 24 - Contains \Drupal\Tests\language\Unit\ConfigurableLanguageUnitTest.
Class
- ConfigurableLanguageUnitTest
- Tests the ConfigurableLanguage entity class.
Namespace
Drupal\Tests\language\UnitCode
public function testDirection() {
// Direction of language writing, an integer. Usually either
// ConfigurableLanguage::DIRECTION_LTR or
// ConfigurableLanguage::DIRECTION_RTL.
$configurableLanguage = new ConfigurableLanguage(array(
'direction' => ConfigurableLanguage::DIRECTION_LTR,
), 'configurable_language');
$this
->assertEquals(ConfigurableLanguage::DIRECTION_LTR, $configurableLanguage
->getDirection());
// Test direction again, setting direction to RTL.
$configurableLanguage = new ConfigurableLanguage(array(
'direction' => ConfigurableLanguage::DIRECTION_RTL,
), 'configurable_language');
$this
->assertEquals(ConfigurableLanguage::DIRECTION_RTL, $configurableLanguage
->getDirection());
}