Skip to content

Commit af76cd8

Browse files
committed
Move SetTranslations method to TestCase
1 parent ebc8cf7 commit af76cd8

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

tests/TestCase.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Illuminate\Support\Collection;
1111
use Illuminate\Support\Facades\App;
1212
use Illuminate\Support\Facades\Config;
13+
use Illuminate\Support\Facades\Lang;
1314
use Illuminate\Support\Facades\Route;
1415
use Orchestra\Testbench\TestCase as BaseTestCase;
1516

@@ -93,6 +94,23 @@ protected function setUseLocalizer($value)
9394
Config::set('localized-routes.use_localizer', $value);
9495
}
9596

97+
/**
98+
* Fake that we created a routes.php file in 'resources/lang/'
99+
* for each language with the given translations.
100+
*
101+
* @param $translations
102+
*
103+
* @return void
104+
*/
105+
protected function setTranslations($translations)
106+
{
107+
Lang::setLoaded([
108+
'*' => [
109+
'routes' => $translations
110+
]
111+
]);
112+
}
113+
96114
/**
97115
* Get the currently registered routes.
98116
*

tests/Unit/Macros/UriTranslationMacroTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,4 @@ public function it_skips_placeholders_in_a_uri()
7878

7979
$this->assertEquals('artikels/{article}', Lang::uri('articles/{article}', 'nl'));
8080
}
81-
82-
/**
83-
* Fake that we created a routes.php file in 'resources/lang/'
84-
* for each language with the given translations.
85-
*
86-
* @param $translations
87-
*
88-
* @return void
89-
*/
90-
protected function setTranslations($translations)
91-
{
92-
Lang::setLoaded([
93-
'*' => [
94-
'routes' => $translations
95-
]
96-
]);
97-
}
9881
}

0 commit comments

Comments
 (0)