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. --- .../active-controls/protected/.htaccess | 1 + .../active-controls/protected/application.xml | 11 +++++ .../protected/pages/ActiveButtonTest.page | 9 ++++ .../protected/pages/ActiveButtonTest.php | 16 ++++++++ .../protected/pages/ActivePanelTest.page | 22 ++++++++++ .../protected/pages/ActivePanelTest.php | 12 ++++++ .../protected/pages/ActiveTextBoxCallback.page | 5 +++ .../protected/pages/ActiveTextBoxCallback.php | 11 +++++ .../protected/pages/AutoCompleteTest.page | 48 ++++++++++++++++++++++ .../protected/pages/AutoCompleteTest.php | 34 +++++++++++++++ .../protected/pages/Calculator.page | 31 ++++++++++++++ .../active-controls/protected/pages/Calculator.php | 12 ++++++ .../protected/pages/CallbackOptionsTest.page | 34 +++++++++++++++ .../protected/pages/FeatureList.page | 3 ++ .../protected/pages/FeatureList.php | 34 +++++++++++++++ .../active-controls/protected/pages/Home.page | 1 + .../protected/pages/NestedActiveControls.page | 28 +++++++++++++ .../protected/pages/NestedActiveControls.php | 19 +++++++++ 18 files changed, 331 insertions(+) create mode 100644 tests/FunctionalTests/active-controls/protected/.htaccess create mode 100755 tests/FunctionalTests/active-controls/protected/application.xml create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/Calculator.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/Calculator.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page create mode 100755 tests/FunctionalTests/active-controls/protected/pages/FeatureList.page create mode 100755 tests/FunctionalTests/active-controls/protected/pages/FeatureList.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/Home.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php (limited to 'tests/FunctionalTests/active-controls/protected') diff --git a/tests/FunctionalTests/active-controls/protected/.htaccess b/tests/FunctionalTests/active-controls/protected/.htaccess new file mode 100644 index 00000000..3418e55a --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/application.xml b/tests/FunctionalTests/active-controls/protected/application.xml new file mode 100755 index 00000000..03fe9bbb --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/application.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page new file mode 100644 index 00000000..5c2d1abb --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page @@ -0,0 +1,9 @@ + +

TActiveButton Functional Test

+ + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php new file mode 100644 index 00000000..6282b804 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php @@ -0,0 +1,16 @@ +label1->Text = "Button 1 was clicked "; + } + + function button2_oncallback($sender, $param) + { + $this->label1->Text .= "using callback!"; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page new file mode 100644 index 00000000..468a524e --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.page @@ -0,0 +1,22 @@ + +

Active Panel replacement tests

+ + + + Something lalala + + +
+ Click Me! +
+ + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php new file mode 100644 index 00000000..79e3d46c --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php @@ -0,0 +1,12 @@ +content1->visible = true; + $this->panel1->flush($param->output); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page new file mode 100644 index 00000000..d0a750ac --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.page @@ -0,0 +1,5 @@ + +

ActiveTextBox Callback Test

+ + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.php new file mode 100644 index 00000000..c3f729e5 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveTextBoxCallback.php @@ -0,0 +1,11 @@ +label1->Text = 'Label 1: '.$sender->Text; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page new file mode 100644 index 00000000..93658bd7 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.page @@ -0,0 +1,48 @@ + + + + +

TAutoComplete Test

+ + + +


+


+


+


+


+


+


+


+


+


+ +
\ No newline at end of file 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 diff --git a/tests/FunctionalTests/active-controls/protected/pages/Calculator.page b/tests/FunctionalTests/active-controls/protected/pages/Calculator.page new file mode 100644 index 00000000..7a565658 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/Calculator.page @@ -0,0 +1,31 @@ + +

Callback Enabled Calculator

+ + + + + + = + + + + + + + +
+ +
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/Calculator.php b/tests/FunctionalTests/active-controls/protected/pages/Calculator.php new file mode 100644 index 00000000..098a8460 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/Calculator.php @@ -0,0 +1,12 @@ +c->Text = floatval($this->a->Text) + floatval($this->b->Text); + } +} + + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page new file mode 100644 index 00000000..6e8b8a1e --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page @@ -0,0 +1,34 @@ + +

TCallbackOptions Test

+ + + + $("status").show(); + + + $("status").hide(); + + + Element.update("label1", "Button 1 has returned"); + + + + + + + Element.update("label2", "Button 2 has returned"); + + + + + Element.update("label3", "Button 3 has returned"); + + + +
Label 1
+
Label 2
+
Label 3
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page new file mode 100755 index 00000000..eab14a87 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.page @@ -0,0 +1,3 @@ + + + diff --git a/tests/FunctionalTests/active-controls/protected/pages/FeatureList.php b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.php new file mode 100755 index 00000000..8f28f6de --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/FeatureList.php @@ -0,0 +1,34 @@ +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/active-controls/protected/pages/Home.page b/tests/FunctionalTests/active-controls/protected/pages/Home.page new file mode 100644 index 00000000..ff226d4e --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/Home.page @@ -0,0 +1 @@ +

Welcome to Prado!

\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page new file mode 100644 index 00000000..d8eacf15 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.page @@ -0,0 +1,28 @@ + +

Nested Active Controls Test

+ + + + Something lalala + + + + + + +
+ Click Me! +
+ + + + +
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php new file mode 100644 index 00000000..a4a22cbf --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php @@ -0,0 +1,19 @@ +content1->visible = true; + $this->panel1->flush($param->output); + } + + function button1_clicked($sender, $param) + { + $this->label1->Text = "Label 1: Button 1 Clicked"; + $this->label2->Text = "Label 2: Button 1 Clicked"; + $this->label3->Text = "Label 3: Button 1 Clicked"; + } +} + +?> \ No newline at end of file -- cgit v1.2.3