From c91ec2590f9c1f7689c468284dc4d523da308897 Mon Sep 17 00:00:00 2001 From: carl <> Date: Sat, 9 Jun 2007 13:26:50 +0000 Subject: added functional test for TActiveHiddenField --- .../protected/pages/ActiveHiddenFieldTest.page | 16 +++++++++++++++ .../protected/pages/ActiveHiddenFieldTest.php | 22 ++++++++++++++++++++ .../tests/ActiveHiddenFieldTestCase.php | 24 ++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.php create mode 100644 tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page new file mode 100644 index 00000000..f0fc4b92 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page @@ -0,0 +1,16 @@ + +

Active HiddenField Test Case

+ + + + +
+ + + +
+
+ +
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.php new file mode 100644 index 00000000..1f7a8a2a --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.php @@ -0,0 +1,22 @@ +HiddenFieldEmpty->setValue('No longer empty'); + $this->ResponseLabel->setText($this->HiddenFieldEmpty->getValue()); + } + + public function onGetValue($sender, $param) + { + $this->ResponseLabel->setText($this->HiddenFieldUsed->getValue()); + } + + public function onGetBothValues($sender, $param) + { + $this->ResponseLabel->setText($this->HiddenFieldEmpty->getValue().'|'.$this->HiddenFieldUsed->getValue()); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php new file mode 100644 index 00000000..259a6516 --- /dev/null +++ b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php @@ -0,0 +1,24 @@ +open("active-controls/index.php?page=ActiveHiddenFieldTest"); + $fieldEmpty = 'No longer empty'; + $fieldUsed = 'My value'; + + $this->verifyTextPresent('Value of current hidden field'); + $this->click('Button1'); + $this->pause(800); + $this->assertText('ResponseLabel', $fieldEmpty); + $this->click('Button2'); + $this->pause(800); + $this->assertText('ResponseLabel', $fieldUsed); + $this->click('Button3'); + $this->pause(800); + $this->assertText('ResponseLabel', $fieldEmpty.'|'.$fieldUsed); + } +} + +?> \ No newline at end of file -- cgit v1.2.3