-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathTestCase.php
55 lines (50 loc) · 1.17 KB
/
TestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace CodeZero\UriTranslator\Tests;
use CodeZero\UriTranslator\UriTranslatorServiceProvider;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Lang;
use Orchestra\Testbench\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
/**
* Set the app locale.
*
* @param string $locale
*
* @return void
*/
protected function setAppLocale($locale)
{
App::setLocale($locale);
}
/**
* Fake that we created a routes.php file in the 'lang' folder
* for each language with the given translations.
*
* @param $translations
* @param string $namespace
*
* @return void
*/
protected function setTranslations($translations, $namespace = '*')
{
Lang::setLoaded([
$namespace => [
'routes' => $translations
]
]);
}
/**
* Get the packages service providers.
*
* @param \Illuminate\Foundation\Application $app
*
* @return array
*/
protected function getPackageProviders($app)
{
return [
UriTranslatorServiceProvider::class,
];
}
}