This commit is contained in:
Pierre Rudloff 2017-05-29 21:13:10 +02:00
parent 68b2cca899
commit ac4bca35a3
2 changed files with 6 additions and 6 deletions

View file

@ -2,6 +2,7 @@
/** /**
* LocaleMiddleware class. * LocaleMiddleware class.
*/ */
namespace Alltube; namespace Alltube;
use Slim\Http\Request; use Slim\Http\Request;
@ -41,7 +42,7 @@ class LocaleMiddleware
} }
/** /**
* Main middleware function * Main middleware function.
* *
* @param Request $request PSR request * @param Request $request PSR request
* @param Response $response PSR response * @param Response $response PSR response

View file

@ -15,7 +15,6 @@ use Slim\Http\Response;
*/ */
class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Prepare tests. * Prepare tests.
*/ */
@ -32,8 +31,8 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
public function testTestLocale() public function testTestLocale()
{ {
$locale = [ $locale = [
'language'=>'fr', 'language'=> 'fr',
'region'=>'FR', 'region' => 'FR',
]; ];
$this->assertEquals('fr_FR', $this->middleware->testLocale($locale)); $this->assertEquals('fr_FR', $this->middleware->testLocale($locale));
} }
@ -46,8 +45,8 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
public function testLocaleWithWrongLocale() public function testLocaleWithWrongLocale()
{ {
$locale = [ $locale = [
'language'=>'foo', 'language'=> 'foo',
'region'=>'BAR' 'region' => 'BAR',
]; ];
$this->assertNull($this->middleware->testLocale($locale)); $this->assertNull($this->middleware->testLocale($locale));
$this->assertNull($this->middleware->testLocale([])); $this->assertNull($this->middleware->testLocale([]));