From b3ceed048bb533a00bbea542f7c12b49c8c83d9b Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 17 Jun 2006 01:55:05 +0000 Subject: Update changes to active controls, add FT tests for active controls, add comments. --- .../protected/pages/AutoCompleteTest.php | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php (limited to 'tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php') diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php new file mode 100644 index 00000000..938b8640 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php @@ -0,0 +1,34 @@ +setDataSource($this->matchCountries($param->getParameter())); + $sender->dataBind(); + $sender->render($param->getOutput()); + } + + protected function matchCountries($token) + { + $info = Prado::createComponent('System.I18N.core.CultureInfo', 'en'); + $list = array(); + $count = 0; + $token = strtolower($token); + foreach($info->getCountries() as $country) + { + if(strpos(strtolower($country), $token) === 0) + { + $list[] = $country; + $count++; + if($count > 10) break; + } + } + return $list; + } +} + +?> \ No newline at end of file -- cgit v1.2.3