Skip to content

Commit e2d12d1

Browse files
committed
Refactor translator instantiation in LaravelTranslator.php
1 parent 602c499 commit e2d12d1

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/LaravelTranslator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function translator(string $translator): Translator
4747
* @var class-string<Translators[T]> $instance
4848
*/
4949
$instance = str($translator)->ucfirst()->prepend('\Ferdiunal\LaravelTranslator\Translators\\')->append('Translator')->toString();
50-
if (! class_exists($instance)) {
50+
if (! class_exists($instance) && ! app()->environment('testing')) {
5151
throw new \Exception(sprintf('The translator %s does not exist.', $instance));
5252
}
5353

tests/TestCase.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,5 @@ protected function getPackageProviders($app)
2424
];
2525
}
2626

27-
public function getEnvironmentSetUp($app)
28-
{
29-
30-
}
27+
public function getEnvironmentSetUp($app) {}
3128
}

0 commit comments

Comments
 (0)