diff --git a/tests/unit/e_formTest.php b/tests/unit/e_formTest.php index 52b617876..fd8b10b59 100644 --- a/tests/unit/e_formTest.php +++ b/tests/unit/e_formTest.php @@ -71,6 +71,7 @@ class e_formTest extends \Codeception\Test\Unit 'checkboxes_001' => array('title'=>'Checkboxes', 'type'=>'checkboxes', 'writeParms'=>array('optArray'=>array(1=>'Check Opt 1', 2=>'Check Opt 2', 3=>'Check Opt 3'))), 'country_001' => array('title'=>'Country', 'type'=>'country'), + 'country_002' => array('title'=>'Country', 'type'=>'country'), 'ip_001' => array('title'=>'IP', 'type'=>'ip', 'inline'=>false), 'templates_001' => array('title'=>'Templates', 'type'=>'templates', 'writeParms'=>array('plugin'=>'forum')), 'radio_001' => array('title'=>'Radio', 'type'=>'radio', 'writeParms'=>array('optArray'=>array(1=>'Radio Opt 1', 2=>'Radio Opt 2', 3=>'Radio Opt 3'))), @@ -119,6 +120,7 @@ class e_formTest extends \Codeception\Test\Unit 'checkboxes_001' => '2,3', 'country_001' => 'au', + 'country_002' => '', 'ip_001' => '::1', 'templates_001' => 'mytemplate', 'radio_001' => 2, @@ -202,12 +204,29 @@ class e_formTest extends \Codeception\Test\Unit { } - +*/ public function testGetCountry() { - } + $tests = array( + array('value'=>'', 'expected'=>''), + array('value'=>'au', 'expected'=>'Australia') + ); + foreach($tests as $t) + { + $actual = $this->_frm->getCountry($t['value']); + $this->assertEquals($t['expected'], $actual); + } + + // return array. + $actual = $this->_frm->getCountry(); + $this->assertArrayHasKey('au',$actual); + + + + } +/* public function testGetRequiredString() { @@ -730,6 +749,7 @@ class e_formTest extends \Codeception\Test\Unit 'checkboxes_001' => 'Check Opt 2, Check Opt 3', 'country_001' => 'Australia', + 'country_002' => '', 'ip_001' => "::1", 'templates_001' => 'mytemplate', 'radio_001' => 'Radio Opt 2', @@ -841,12 +861,12 @@ class e_formTest extends \Codeception\Test\Unit 'checkboxes_001' => "
", 'country_001' => "", - 'ip_001' => "", - 'templates_001' => "", + 'ip_001' => "", + 'templates_001' => "", 'radio_001' => " ", //todo check tags_001 is correct. - 'tags_001' => "", + 'tags_001' => "", // 'bbarea_001' => 'bold', // 'icon_001' => "e107_icon_32.png", @@ -855,15 +875,15 @@ class e_formTest extends \Codeception\Test\Unit // 'files_001' => '{e_MEDIA_FILE}test.zip', 'datestamp_001' => "", 'date_001' => "", - 'userclass_001' => "", - 'userclasses_001' => "", + 'userclass_001' => "", + 'userclasses_001' => "", //todo check user_001 is correct - 'user_001' => "", - 'url_001' => "", - 'email_001' => "", + 'user_001' => "", + 'url_001' => "", + 'email_001' => "", 'hidden_001' => "", // 'method_001' => 'custom-value', - 'language_001' => "", + 'language_001' => "", // 'lanlist_001' => 'German', // only works with multiple languages installed. );