File tree Expand file tree Collapse file tree
library/Application/Form/Element
tests/library/Application/Form/Element Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,14 @@ public function setValue($value)
6969 }
7070 }
7171
72+ if (! in_array ($ value , array_keys (self ::getLanguageList ()))) {
73+ $ label = Locale::getDisplayName ($ value );
74+ if ($ label !== $ value ) {
75+ $ label .= " ( {$ value }) " ;
76+ }
77+ $ this ->addMultiOption ($ value , $ label );
78+ }
79+
7280 parent ::setValue ($ value );
7381 }
7482
Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ public function testAutoMapValueToLanguageId()
104104
105105 public function testUnknownLanguage ()
106106 {
107- $ this ->markTestIncomplete ();
107+ $ language = $ this ->getElement ();
108+ $ langCode = 'cmn ' ;
109+
110+ $ language ->setValue ($ langCode );
111+ $ this ->assertEquals ($ langCode , $ language ->getValue ());
112+ $ this ->assertTrue ($ language ->isValid ($ langCode ));
108113 }
109114}
You can’t perform that action at this time.
0 commit comments