12
12
*/
13
13
class LanguageAddCase extends CommandUnishTestCase
14
14
{
15
-
16
- public function testLanguageInfo ()
15
+ protected function setUp ()
17
16
{
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
+ }
23
22
}
24
23
25
- public function testLanguageAdd ()
24
+ public function testLanguageInfoAdd ()
26
25
{
27
- $ this ->setUpDrupal ( 1 , true );
28
- $ this ->drush ( ' pm-enable ' , [ ' language ' ] );
26
+ $ this ->drush ( ' language-info ' , [] );
27
+ $ this ->assertContains ( ' English (en) ' , $ this -> getSimplifiedOutput () );
29
28
30
29
$ this ->drush ('language-add ' , ['nl,fr ' ], ['skip-translations ' => null ]);
31
30
@@ -36,9 +35,6 @@ public function testLanguageAdd()
36
35
37
36
public function testLanguageAddWithTranslations ()
38
37
{
39
- $ this ->setUpDrupal (1 , true );
40
- $ root = $ this ->webroot ();
41
-
42
38
$ this ->drush ('pm-enable ' , ['language ' , 'locale ' , 'dblog ' ]);
43
39
$ this ->drush ('config-set ' , ['locale.settings ' , 'translation.import_enabled ' , true ]);
44
40
@@ -49,7 +45,7 @@ public function testLanguageAddWithTranslations()
49
45
$ this ->drush ('config-set ' , ['locale.settings ' , 'translation.default_filename ' , '%project.%language.po ' ]);
50
46
$ this ->drush ('config-set ' , ['locale.settings ' , 'translation.path ' , '../translations ' ]);
51
47
$ source = Path::join (__DIR__ , '/resources/devel.nl.po ' );
52
- $ translationDir = Path::join ($ root , '../translations ' );
48
+ $ translationDir = Path::join ($ this -> webroot () , '../translations ' );
53
49
$ this ->mkdir ($ translationDir );
54
50
copy ($ source , $ translationDir . '/devel.nl.po ' );
55
51
0 commit comments