Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0869737

Browse files
authored
Do one setup for locale tests. (#3889)
1 parent 9666f61 commit 0869737

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

tests/functional/LanguageAddTest.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,19 @@
1212
*/
1313
class LanguageAddCase extends CommandUnishTestCase
1414
{
15-
16-
public function testLanguageInfo()
15+
protected function setUp()
1716
{
18-
$this->setUpDrupal(1, true);
19-
$this->drush('pm-enable', ['language']);
20-
21-
$this->drush('language-info', []);
22-
$this->assertContains('English (en)', $this->getSimplifiedOutput());
17+
parent::setUp();
18+
if (empty($this->getSites())) {
19+
$this->setUpDrupal(1, true);
20+
$this->drush('pm-enable', ['language']);
21+
}
2322
}
2423

25-
public function testLanguageAdd()
24+
public function testLanguageInfoAdd()
2625
{
27-
$this->setUpDrupal(1, true);
28-
$this->drush('pm-enable', ['language']);
26+
$this->drush('language-info', []);
27+
$this->assertContains('English (en)', $this->getSimplifiedOutput());
2928

3029
$this->drush('language-add', ['nl,fr'], ['skip-translations' => null]);
3130

@@ -36,9 +35,6 @@ public function testLanguageAdd()
3635

3736
public function testLanguageAddWithTranslations()
3837
{
39-
$this->setUpDrupal(1, true);
40-
$root = $this->webroot();
41-
4238
$this->drush('pm-enable', ['language', 'locale', 'dblog']);
4339
$this->drush('config-set', ['locale.settings', 'translation.import_enabled', true]);
4440

@@ -49,7 +45,7 @@ public function testLanguageAddWithTranslations()
4945
$this->drush('config-set', ['locale.settings', 'translation.default_filename', '%project.%language.po']);
5046
$this->drush('config-set', ['locale.settings', 'translation.path', '../translations']);
5147
$source = Path::join(__DIR__, '/resources/devel.nl.po');
52-
$translationDir = Path::join($root, '../translations');
48+
$translationDir = Path::join($this->webroot(), '../translations');
5349
$this->mkdir($translationDir);
5450
copy($source, $translationDir . '/devel.nl.po');
5551

0 commit comments

Comments
 (0)