File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 12
12
namespace CodeIgniter \HTTP ;
13
13
14
14
use Config \App ;
15
+ use Locale ;
15
16
use RuntimeException ;
16
17
17
18
/**
@@ -280,4 +281,13 @@ private function returnNullOrEmptyArray($index)
280
281
{
281
282
return ($ index === null || is_array ($ index )) ? [] : null ;
282
283
}
284
+
285
+ /**
286
+ * Gets the current locale, with a fallback to the default
287
+ * locale if none is set.
288
+ */
289
+ public function getLocale (): string
290
+ {
291
+ return Locale::getDefault ();
292
+ }
283
293
}
Original file line number Diff line number Diff line change @@ -599,16 +599,21 @@ public function testGetGet()
599
599
600
600
public function testGetPost ()
601
601
{
602
- $ this ->assertSame ([], $ this ->request ->getGet ());
602
+ $ this ->assertSame ([], $ this ->request ->getPost ());
603
603
}
604
604
605
605
public function testGetPostGet ()
606
606
{
607
- $ this ->assertSame ([], $ this ->request ->getGet ());
607
+ $ this ->assertSame ([], $ this ->request ->getPostGet ());
608
608
}
609
609
610
610
public function testGetGetPost ()
611
611
{
612
- $ this ->assertSame ([], $ this ->request ->getGet ());
612
+ $ this ->assertSame ([], $ this ->request ->getGetPost ());
613
+ }
614
+
615
+ public function testGetLocale ()
616
+ {
617
+ $ this ->assertSame ('en ' , $ this ->request ->getLocale ());
613
618
}
614
619
}
You can’t perform that action at this time.
0 commit comments