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 1212namespace CodeIgniter \HTTP ;
1313
1414use Config \App ;
15+ use Locale ;
1516use RuntimeException ;
1617
1718/**
@@ -280,4 +281,13 @@ private function returnNullOrEmptyArray($index)
280281 {
281282 return ($ index === null || is_array ($ index )) ? [] : null ;
282283 }
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+ }
283293}
Original file line number Diff line number Diff line change @@ -599,16 +599,21 @@ public function testGetGet()
599599
600600 public function testGetPost ()
601601 {
602- $ this ->assertSame ([], $ this ->request ->getGet ());
602+ $ this ->assertSame ([], $ this ->request ->getPost ());
603603 }
604604
605605 public function testGetPostGet ()
606606 {
607- $ this ->assertSame ([], $ this ->request ->getGet ());
607+ $ this ->assertSame ([], $ this ->request ->getPostGet ());
608608 }
609609
610610 public function testGetGetPost ()
611611 {
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 ());
613618 }
614619}
You can’t perform that action at this time.
0 commit comments