Commit 4b42df3d authored by alexpott's avatar alexpott

Issue #2318817 by alimac, martin107: Remove method setId() from...

Issue #2318817 by alimac, martin107: Remove method setId() from core/lib/Drupal/Core/Language/LanguageInterface.
parent 83f868b5
......@@ -139,15 +139,6 @@ public function getId() {
return $this->id;
}
/**
* {@inheritdoc}
*/
public function setId($id) {
$this->id = $id;
return $this;
}
/**
* {@inheritdoc}
*/
......
......@@ -122,16 +122,6 @@ public function setName($name);
*/
public function getId();
/**
* Sets the ID (language code).
*
* @param string $id
* The language code.
*
* @return $this
*/
public function setId($id);
/**
* Gets the text direction (left-to-right or right-to-left).
*
......
......@@ -47,12 +47,11 @@ public function testGetName() {
* Tests langcode ID getter and setter methods.
*
* @covers ::getId()
* @covers ::setId()
*/
public function testGetLangcode() {
$language_code = $this->randomMachineName(2);
$this->assertSame($this->language, $this->language->setId($language_code));
$this->assertSame($language_code, $this->language->getId());
$language = new Language(array('id' => $language_code));
$this->assertSame($language_code, $language->getId());
}
/**
......@@ -115,20 +114,17 @@ public function testSortArrayOfLanguages(array $languages, array $expected) {
* An array of test data.
*/
public function providerTestSortArrayOfLanguages() {
$language9A = new Language();
$language9A = new Language(array('id' => 'dd'));
$language9A->setName('A');
$language9A->setWeight(9);
$language9A->setId('dd');
$language10A = new Language();
$language10A = new Language(array('id' => 'ee'));
$language10A->setName('A');
$language10A->setWeight(10);
$language10A->setId('ee');
$language10B = new Language();
$language10B = new Language(array('id' => 'ff'));
$language10B->setName('B');
$language10B->setWeight(10);
$language10B->setId('ff');
return array(
// Set up data set #0, already ordered by weight.
......
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