diff options
| author | wei <> | 2006-06-17 01:55:05 +0000 | 
|---|---|---|
| committer | wei <> | 2006-06-17 01:55:05 +0000 | 
| commit | b3ceed048bb533a00bbea542f7c12b49c8c83d9b (patch) | |
| tree | 97962fc3cb6746ae404c4f1d0095834bbb0e1ac7 /tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php | |
| parent | 6c0154fb4e292ad22667e618f598a37cc5f9d524 (diff) | |
Update changes to active controls, add FT tests for active controls, add comments.
Diffstat (limited to 'tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php')
| -rw-r--r-- | tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php | 34 | 
1 files changed, 34 insertions, 0 deletions
| 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 @@ +<?php +/* + * Created on 7/05/2006 + */ + +class AutoCompleteTest extends TPage +{ +	public function suggestCountries($sender, $param) +	{ +		$sender->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 | 
