Commit d247620e authored by Dries's avatar Dries

Issue #2286403 by martin107: Inconsistent use of magic number when constants...

Issue #2286403 by martin107: Inconsistent use of magic number when constants DIRECTION_LTR and DIRECTION_RTL already defined.
parent 14ea687e
......@@ -22,7 +22,7 @@ class Language implements LanguageInterface {
public static $defaultValues = array(
'id' => 'en',
'name' => 'English',
'direction' => 0,
'direction' => self::DIRECTION_LTR,
'weight' => 0,
'locked' => 0,
'default' => TRUE,
......
......@@ -7,6 +7,7 @@
namespace Drupal\config\Tests;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
/**
......@@ -42,7 +43,7 @@ function testSiteNameTranslation() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
\Drupal::languageManager()
......
......@@ -577,7 +577,7 @@ public function testLocaleDBStorage() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => Language::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......
......@@ -57,7 +57,7 @@ protected function setUp() {
$language = new Language(array(
'id' => 'it',
'name' => 'Italian',
'direction' => '0',
'direction' => Language::DIRECTION_LTR,
));
language_save($language);
......
......@@ -52,7 +52,7 @@ function testDependencyInjectedNewDefaultLanguage() {
$new_language_default = new Language(array(
'id' => 'fr',
'name' => 'French',
'direction' => 0,
'direction' => Language::DIRECTION_LTR,
'weight' => 0,
'method_id' => 'language-default',
'default' => TRUE,
......
......@@ -55,7 +55,7 @@ function testLanguageList() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => Language::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
......@@ -139,7 +139,7 @@ function testLanguageList() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => Language::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
$this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
......
......@@ -9,6 +9,7 @@
use Drupal\simpletest\WebTestBase;
use Drupal\locale\LocaleTypedConfig;
use Drupal\core\language\languageInterface;
/**
* Tests Metadata for configuration objects.
......@@ -55,7 +56,7 @@ function testConfigTranslation() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
// Set path prefix.
......
......@@ -8,6 +8,7 @@
namespace Drupal\locale\Tests;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Language\LanguageInterface;
/**
* Functional tests for multilingual support on nodes.
......@@ -80,7 +81,7 @@ function testContentTypeLanguageConfiguration() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......
......@@ -8,6 +8,7 @@
namespace Drupal\locale\Tests;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Language\LanguageInterface;
/**
* Functional tests for the import of translation files.
......@@ -268,7 +269,7 @@ function testConfigPoFile() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $this->randomName(16),
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......
......@@ -41,7 +41,7 @@ public function testCircularDependency() {
$new_language_default = new Language(array(
'id' => 'fr',
'name' => 'French',
'direction' => 0,
'direction' => LANGUAGE::DIRECTION_LTR,
'weight' => 0,
'method_id' => 'language-default',
'default' => TRUE,
......
......@@ -56,7 +56,7 @@ function testPathLanguageConfiguration() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......
......@@ -65,7 +65,7 @@ function testStringTranslation() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
// Add string.
......@@ -222,7 +222,7 @@ function testJavaScriptTranslation() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
$this->container->get('language_manager')->reset();
......@@ -292,7 +292,7 @@ function testStringValidation() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
// Add string.
......@@ -342,7 +342,7 @@ function testStringSearch() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......@@ -350,7 +350,7 @@ function testStringSearch() {
'predefined_langcode' => 'custom',
'langcode' => 'yy',
'name' => $this->randomName(16),
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......
......@@ -7,6 +7,7 @@
namespace Drupal\locale\Tests;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
/**
......@@ -410,7 +411,7 @@ function testEnableCustomLanguage() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......
......@@ -7,6 +7,7 @@
namespace Drupal\system\Tests\Theme;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
/**
......@@ -231,7 +232,7 @@ protected function installLanguages() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
// Install the language in Drupal.
......
......@@ -8,6 +8,7 @@
namespace Drupal\toolbar\Tests;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
/**
......@@ -377,7 +378,7 @@ function testLocaleTranslationSubtreesHashCacheClear() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
t($name, array(), array('langcode' => $langcode));
......@@ -463,7 +464,7 @@ function testSubtreesJsonRequest() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......@@ -488,7 +489,7 @@ function testLanguageSwitching() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
......
......@@ -7,6 +7,7 @@
namespace Drupal\user\Tests;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
/**
......@@ -137,7 +138,7 @@ function addCustomLanguage() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
}
......
......@@ -7,6 +7,7 @@
namespace Drupal\user\Tests;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
/**
......@@ -48,7 +49,7 @@ function testUserLanguageConfiguration() {
'predefined_langcode' => 'custom',
'langcode' => $langcode,
'name' => $name,
'direction' => '0',
'direction' => LanguageInterface::DIRECTION_LTR,
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
$this->drupalLogout();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment