Skip to content

Commit 84e1dcc

Browse files
Mohammad Roseffendimartinlindhe
Mohammad Roseffendi
authored andcommitted
Fix lang generation caused by missleading test case (martinlindhe#38)
* Added vendor directory parsing * Added with-vendor command options * Added with-vendor command options * fixed test temp directory path * Fix lang generation caused by missleading test case * Change phpunit version to support php 5.6 * Revert back phpunit version to continue current support * Update composer lock file * Revert back composer lock file * Update phpunit base test class * Fix testcase
1 parent 4fd4bf8 commit 84e1dcc

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Generator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private function adjustVendor($locales)
237237
foreach($locales['vendor'] as $vendor => $data) {
238238
foreach($data as $key => $group) {
239239
foreach($group as $locale => $lang) {
240-
$locales[$locale]['vendor'][$vendor][$key] = $lang;
240+
$locales[$key]['vendor'][$vendor][$locale] = $lang;
241241
}
242242
}
243243
}

tests/GenerateTest.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class GenerateTest extends \PHPUnit_Framework_TestCase
77
private function generateLocaleFilesFrom(array $arr)
88
{
99
$root = sys_get_temp_dir() . '/' . sha1(microtime(true) . mt_rand());
10-
10+
1111
if (!is_dir($root)) {
1212
mkdir($root, 0777, true);
1313
}
@@ -144,11 +144,13 @@ function testBasicWithVendor()
144144
],
145145
'vendor' => [
146146
'test-vendor' => [
147-
'test-lang' => [
148-
'en' => [
147+
'en' => [
148+
'test-lang' => [
149149
'maybe' => 'maybe'
150-
],
151-
'sv' => [
150+
]
151+
],
152+
'sv' => [
153+
'test-lang' => [
152154
'maybe' => 'kanske'
153155
]
154156
]

0 commit comments

Comments
 (0)