summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/features/protected/pages
diff options
context:
space:
mode:
authorctrlaltca <>2012-07-12 11:21:01 +0000
committerctrlaltca <>2012-07-12 11:21:01 +0000
commit903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch)
treee08bf04f0823650a231227ac3499121270172a23 /tests/FunctionalTests/features/protected/pages
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'tests/FunctionalTests/features/protected/pages')
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php86
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php66
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator.php28
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php38
-rw-r--r--tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php70
-rw-r--r--tests/FunctionalTests/features/protected/pages/FeatureList.php66
-rw-r--r--tests/FunctionalTests/features/protected/pages/FocusControl.php32
-rw-r--r--tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php88
-rw-r--r--tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php62
-rw-r--r--tests/FunctionalTests/features/protected/pages/TestComp.php38
-rw-r--r--tests/FunctionalTests/features/protected/pages/myscripts/packages.php18
11 files changed, 296 insertions, 296 deletions
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php
index b2dd2233..322f4db7 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php
@@ -1,43 +1,43 @@
-<?php
-/*
- * Created on 2/05/2006
- */
-
-class ActiveControl extends TPage
-{
- static private $_colors = array('red', 'green', 'blue', 'purple','black','orange');
-
- public function slowResponse($sender, $param)
- {
- //sleep(1);
- $this->label1->setText("The time is ".time()." from ".$sender->ID);
- $this->label1->setForeColor($this->getColor());
- $this->label1->renderControl($param->getOutput());
-
- $this->button2->setEnabled(true);
-
- $this->panel2->setVisible(true);
- $this->panel1->setBackColor($this->getColor());
- $this->panel1->renderControl($param->getOutput());
- $this->getCallbackClient()->shake($this->panel1);
- }
-
- public function onButtonClicked($sender, $param)
- {
- $this->label2->setText("Muahaha !!! the time is ".time()." from ".$sender->ID);
- }
-
- public function fastResponse($sender, $param)
- {
- $this->button2->setEnabled(false);
- $style['color'] = $this->getColor();
- $this->getCallbackClient()->setStyle($this->label2, $style);
- $this->getCallbackClient()->shake($this->label2);
- }
-
- private function getColor()
- {
- return self::$_colors[rand(0,count(self::$_colors)-1)];
- }
-}
-?>
+<?php
+/*
+ * Created on 2/05/2006
+ */
+
+class ActiveControl extends TPage
+{
+ static private $_colors = array('red', 'green', 'blue', 'purple','black','orange');
+
+ public function slowResponse($sender, $param)
+ {
+ //sleep(1);
+ $this->label1->setText("The time is ".time()." from ".$sender->ID);
+ $this->label1->setForeColor($this->getColor());
+ $this->label1->renderControl($param->getOutput());
+
+ $this->button2->setEnabled(true);
+
+ $this->panel2->setVisible(true);
+ $this->panel1->setBackColor($this->getColor());
+ $this->panel1->renderControl($param->getOutput());
+ $this->getCallbackClient()->shake($this->panel1);
+ }
+
+ public function onButtonClicked($sender, $param)
+ {
+ $this->label2->setText("Muahaha !!! the time is ".time()." from ".$sender->ID);
+ }
+
+ public function fastResponse($sender, $param)
+ {
+ $this->button2->setEnabled(false);
+ $style['color'] = $this->getColor();
+ $this->getCallbackClient()->setStyle($this->label2, $style);
+ $this->getCallbackClient()->shake($this->label2);
+ }
+
+ private function getColor()
+ {
+ return self::$_colors[rand(0,count(self::$_colors)-1)];
+ }
+}
+?>
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php
index 3474234e..ac08e4ed 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/AutoComplete.php
@@ -1,34 +1,34 @@
-<?php
-/*
- * Created on 7/05/2006
- */
-
-class AutoComplete 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;
- }
-}
-
+<?php
+/*
+ * Created on 7/05/2006
+ */
+
+class AutoComplete 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
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator.php
index 9821d8c9..7afd1d59 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator.php
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator.php
@@ -1,15 +1,15 @@
-<?php
-/*
- * Created on 6/05/2006
- */
-Prado::using('System.Web.UI.ActiveControls.*');
-
-class Calculator extends TPage
-{
- public function do_sum($sender, $param)
- {
- $this->c->Text = floatval($this->a->Text) + floatval($this->b->Text);
- }
-}
-
+<?php
+/*
+ * Created on 6/05/2006
+ */
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Calculator extends TPage
+{
+ public function do_sum($sender, $param)
+ {
+ $this->c->Text = floatval($this->a->Text) + floatval($this->b->Text);
+ }
+}
+
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php
index df07440f..3789a3f9 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/Calculator2.php
@@ -1,20 +1,20 @@
-<?php
-/*
- * Created on 13/05/2006
- */
-
-class Calculator2 extends TPage
-{
- public function do_sum($sender, $param)
- {
- $this->c->Text = floatval($this->a->Text) + floatval($this->b->Text);
- }
-
- public function update_callback($sender, $param)
- {
- $this->do_sum($this->sum, null);
- $this->panel1->renderControl($param->Output);
- }
-}
-
+<?php
+/*
+ * Created on 13/05/2006
+ */
+
+class Calculator2 extends TPage
+{
+ public function do_sum($sender, $param)
+ {
+ $this->c->Text = floatval($this->a->Text) + floatval($this->b->Text);
+ }
+
+ public function update_callback($sender, $param)
+ {
+ $this->do_sum($this->sum, null);
+ $this->panel1->renderControl($param->Output);
+ }
+}
+
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php b/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php
index 0c9b16d5..1b1d0cbc 100644
--- a/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php
+++ b/tests/FunctionalTests/features/protected/pages/ActiveControls/VisibleUpdate.php
@@ -1,36 +1,36 @@
-<?php
-/*
- * Created on 13/05/2006
- */
-
-class VisibleUpdate extends TPage
-{
- function click1($sender)
- {
- $this->label1->setText($this->getButtonState($sender));
-
- //$this->button1->setEnabled(false);
- $this->button1->setVisible(false);
- // $this->button2->setEnabled(true);
- $this->button2->setVisible(true);
- }
-
- function click2($sender)
- {
- $this->label1->setText($this->getButtonState($sender));
-
- // $this->button1->setEnabled(true);
- $this->button1->setVisible(true);
- /// $this->button2->setEnabled(false);
- $this->button2->setVisible(false);
- }
-
- protected function getButtonState($button)
- {
- return "Before you clicked on ".$button->Text.
- ", Button 1 was ".($this->button1->Enabled ? 'enabled' : 'disabled').
- " and Button 2 was ".($this->button2->Enabled ? 'enabled' : 'disabled');
- }
-}
-
+<?php
+/*
+ * Created on 13/05/2006
+ */
+
+class VisibleUpdate extends TPage
+{
+ function click1($sender)
+ {
+ $this->label1->setText($this->getButtonState($sender));
+
+ //$this->button1->setEnabled(false);
+ $this->button1->setVisible(false);
+ // $this->button2->setEnabled(true);
+ $this->button2->setVisible(true);
+ }
+
+ function click2($sender)
+ {
+ $this->label1->setText($this->getButtonState($sender));
+
+ // $this->button1->setEnabled(true);
+ $this->button1->setVisible(true);
+ /// $this->button2->setEnabled(false);
+ $this->button2->setVisible(false);
+ }
+
+ protected function getButtonState($button)
+ {
+ return "Before you clicked on ".$button->Text.
+ ", Button 1 was ".($this->button1->Enabled ? 'enabled' : 'disabled').
+ " and Button 2 was ".($this->button2->Enabled ? 'enabled' : 'disabled');
+ }
+}
+
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/FeatureList.php b/tests/FunctionalTests/features/protected/pages/FeatureList.php
index 7f82d34e..8f28f6de 100644
--- a/tests/FunctionalTests/features/protected/pages/FeatureList.php
+++ b/tests/FunctionalTests/features/protected/pages/FeatureList.php
@@ -1,34 +1,34 @@
-<?php
-
-class FeatureList extends TPage
-{
- public function onLoad($param)
- {
- parent::onLoad($param);
- $list=$this->getPageList(dirname(__FILE__),'');
- $this->List->DataSource=$list;
- $this->List->dataBind();
- }
-
- protected function getPageList($directory,$basePath)
- {
- $list=array();
- $folder=@opendir($directory);
- while($entry=@readdir($folder))
- {
- if($entry[0]==='.')
- continue;
- else if(is_file($directory.'/'.$entry))
- {
- if(($page=basename($entry,'.page'))!==$entry && strpos($page,'.')===false)
- $list['?page='.$basePath.$page]=$basePath.$page;
- }
- else
- $list=array_merge($list,$this->getPageList($directory.'/'.$entry,$basePath.$entry.'.'));
- }
- closedir($folder);
- return $list;
- }
-}
-
+<?php
+
+class FeatureList extends TPage
+{
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ $list=$this->getPageList(dirname(__FILE__),'');
+ $this->List->DataSource=$list;
+ $this->List->dataBind();
+ }
+
+ protected function getPageList($directory,$basePath)
+ {
+ $list=array();
+ $folder=@opendir($directory);
+ while($entry=@readdir($folder))
+ {
+ if($entry[0]==='.')
+ continue;
+ else if(is_file($directory.'/'.$entry))
+ {
+ if(($page=basename($entry,'.page'))!==$entry && strpos($page,'.')===false)
+ $list['?page='.$basePath.$page]=$basePath.$page;
+ }
+ else
+ $list=array_merge($list,$this->getPageList($directory.'/'.$entry,$basePath.$entry.'.'));
+ }
+ closedir($folder);
+ return $list;
+ }
+}
+
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/FocusControl.php b/tests/FunctionalTests/features/protected/pages/FocusControl.php
index d78f28c4..e534a92a 100644
--- a/tests/FunctionalTests/features/protected/pages/FocusControl.php
+++ b/tests/FunctionalTests/features/protected/pages/FocusControl.php
@@ -1,17 +1,17 @@
-<?php
-
-class FocusControl extends TPage
-{
- function doFocus($sender, $param)
- {
- $selected = $this->list->SelectedIndex;
- if($selected >= 0)
- {
- $id = "button".($selected+1);
- $controlID = $this->{$id}->ClientID;
- $this->ClientScript->registerFocusControl($controlID);
- }
- }
-}
-
+<?php
+
+class FocusControl extends TPage
+{
+ function doFocus($sender, $param)
+ {
+ $selected = $this->list->SelectedIndex;
+ if($selected >= 0)
+ {
+ $id = "button".($selected+1);
+ $controlID = $this->{$id}->ClientID;
+ $this->ClientScript->registerFocusControl($controlID);
+ }
+ }
+}
+
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
index cac0a04e..929e2f17 100644
--- a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
+++ b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
@@ -1,45 +1,45 @@
-<?php
-
-/**
- * ${classname}
- *
- * ${description}
- *
- * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
- * @package ${package}
- */
-class BasicI18N extends TPage
-{
-}
-
-/**
- * ${classname}
- *
- * ${description}
- *
- * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
- * @package ${package}
- *//*
-class BasicI18NTestCase extends SeleniumTestCase
-{
- function setup()
- {
- $page = Prado::getApplication()->getTestPage(__FILE__);
- $this->open($page);
- }
-
- function testI18N()
- {
- $this->verifyTitle("Basic I18N Test", "");
- $this->verifyTextPresent("Hello", "");
- $this->verifyTextPresent("US$10,000.00", "");
- $this->verifyTextPresent("2006年1月15日 上午12时00分00秒", "");
- $this->verifyTextPresent("None", "");
- $this->verifyTextPresent("One thing.", "");
- $this->verifyTextPresent("Many things.", "");
- }
-}
-*/
+<?php
+
+/**
+ * ${classname}
+ *
+ * ${description}
+ *
+ * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
+ * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
+ * @package ${package}
+ */
+class BasicI18N extends TPage
+{
+}
+
+/**
+ * ${classname}
+ *
+ * ${description}
+ *
+ * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
+ * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
+ * @package ${package}
+ *//*
+class BasicI18NTestCase extends SeleniumTestCase
+{
+ function setup()
+ {
+ $page = Prado::getApplication()->getTestPage(__FILE__);
+ $this->open($page);
+ }
+
+ function testI18N()
+ {
+ $this->verifyTitle("Basic I18N Test", "");
+ $this->verifyTextPresent("Hello", "");
+ $this->verifyTextPresent("US$10,000.00", "");
+ $this->verifyTextPresent("2006年1月15日 上午12时00分00秒", "");
+ $this->verifyTextPresent("None", "");
+ $this->verifyTextPresent("One thing.", "");
+ $this->verifyTextPresent("Many things.", "");
+ }
+}
+*/
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php b/tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php
index 964b48a5..72e6061e 100644
--- a/tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php
+++ b/tests/FunctionalTests/features/protected/pages/MyJavascriptLib.php
@@ -1,32 +1,32 @@
-<?php
-
-class MyJavascriptLib extends TComponent
-{
- private $_packages=array(); //keep track of all registrations
-
- private $_manager;
-
- protected function __construct(TPage $owner)
- {
- $this->_manager = $owner->getClientScript();
- $owner->onPreRenderComplete = array($this, 'registerScriptLoader');
- }
-
- public static function registerPackage(TControl $control, $name)
- {
- static $instance;
- if($instance===null)
- $instance=new self($control->getPage());
- $instance->_packages[$name]=true;
- }
-
- protected function registerScriptLoader()
- {
- $dir = dirname(__FILE__).'/myscripts'; //contains my javascript files
- $scripts = array_keys($this->_packages);
- $url = $this->_manager->registerJavascriptPackages($dir, $scripts);
- $this->_manager->registerScriptFile($url,$url);
- }
-}
-
+<?php
+
+class MyJavascriptLib extends TComponent
+{
+ private $_packages=array(); //keep track of all registrations
+
+ private $_manager;
+
+ protected function __construct(TPage $owner)
+ {
+ $this->_manager = $owner->getClientScript();
+ $owner->onPreRenderComplete = array($this, 'registerScriptLoader');
+ }
+
+ public static function registerPackage(TControl $control, $name)
+ {
+ static $instance;
+ if($instance===null)
+ $instance=new self($control->getPage());
+ $instance->_packages[$name]=true;
+ }
+
+ protected function registerScriptLoader()
+ {
+ $dir = dirname(__FILE__).'/myscripts'; //contains my javascript files
+ $scripts = array_keys($this->_packages);
+ $url = $this->_manager->registerJavascriptPackages($dir, $scripts);
+ $this->_manager->registerScriptFile($url,$url);
+ }
+}
+
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/TestComp.php b/tests/FunctionalTests/features/protected/pages/TestComp.php
index f9d02c77..0358357a 100644
--- a/tests/FunctionalTests/features/protected/pages/TestComp.php
+++ b/tests/FunctionalTests/features/protected/pages/TestComp.php
@@ -1,20 +1,20 @@
-<?php
-
-Prado::using('Application.pages.MyJavascriptLib');
-
-class TestComp extends TControl
-{
- private $_class;
- public function setClass($value)
- {
- $this->_class=$value;
- }
-
- public function onPreRender($param)
- {
- parent::onPreRender($param);
- MyJavascriptLib::registerPackage($this,$this->_class);
- }
-}
-
+<?php
+
+Prado::using('Application.pages.MyJavascriptLib');
+
+class TestComp extends TControl
+{
+ private $_class;
+ public function setClass($value)
+ {
+ $this->_class=$value;
+ }
+
+ public function onPreRender($param)
+ {
+ parent::onPreRender($param);
+ MyJavascriptLib::registerPackage($this,$this->_class);
+ }
+}
+
?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/myscripts/packages.php b/tests/FunctionalTests/features/protected/pages/myscripts/packages.php
index 41561a71..e39199f9 100644
--- a/tests/FunctionalTests/features/protected/pages/myscripts/packages.php
+++ b/tests/FunctionalTests/features/protected/pages/myscripts/packages.php
@@ -1,10 +1,10 @@
-<?php
-
-$packages['test'] = array('test.js');
-
-$deps['test'] = array('test');
-$deps['test2'] = array('test');
-
-return array($packages,$deps);
-
+<?php
+
+$packages['test'] = array('test.js');
+
+$deps['test'] = array('test');
+$deps['test2'] = array('test');
+
+return array($packages,$deps);
+
?> \ No newline at end of file