diff --git a/src/helpers.php b/src/helpers.php index 0171f5f..f5e262d 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -6,7 +6,7 @@ * * @param string|null $locale */ - function faker(string $locale = '') : \Xefi\Faker\Faker + function faker(null|string $locale = '') : \Xefi\Faker\Faker { if ($locale === '') { $locale = app()->bound('config') ? diff --git a/tests/Unit/HelperTest.php b/tests/Unit/HelperTest.php index e142018..e80c426 100644 --- a/tests/Unit/HelperTest.php +++ b/tests/Unit/HelperTest.php @@ -11,4 +11,10 @@ public function testFakerHelper() { $this->assertInstanceOf(Faker::class, $faker); } + + public function testFakerHelperWithNullLocale() { + $faker = faker(null); + + $this->assertEquals(null, $faker->getLocale()); + } } \ No newline at end of file