diff --git a/classes/Locale.php b/classes/Locale.php index cf6f602..0914ab1 100644 --- a/classes/Locale.php +++ b/classes/Locale.php @@ -88,6 +88,11 @@ class Locale return strtolower($this->region); } + /** + * Get country information from locale. + * + * @return \Rinvex\Country\Country + */ public function getCountry() { return country($this->getIso3166()); diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 7b8d795..86fdc9c 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -64,6 +64,15 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase $this->assertNull($this->middleware->testLocale([])); } + /** + * Mock function that does nothing. + * + * @return void + */ + public function nothing() + { + } + /** * Test the __invoke() function. * @@ -75,8 +84,7 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase $this->middleware->__invoke( $request->withHeader('Accept-Language', 'fr-FR'), new Response(), - function () { - } + [$this, 'nothing'] ); } @@ -91,8 +99,7 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase $this->middleware->__invoke( $request->withoutHeader('Accept-Language'), new Response(), - function () { - } + [$this, 'nothing'] ); }