summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarl <>2007-06-09 13:26:50 +0000
committercarl <>2007-06-09 13:26:50 +0000
commitc91ec2590f9c1f7689c468284dc4d523da308897 (patch)
tree48408a62100ecc39574328f1d4cd04f959a25552
parentc6d4662e08b300ae2d388322f8be8e6d61994074 (diff)
added functional test for TActiveHiddenField
-rw-r--r--.gitattributes3
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page16
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.php22
-rw-r--r--tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php24
4 files changed, 65 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index dac70fb0..755e05e5 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2240,6 +2240,8 @@ tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag
tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page -text
tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page -text
tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveLinkButtonTest.page -text
@@ -2328,6 +2330,7 @@ tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.p
tests/FunctionalTests/active-controls/protected/pages/group.gif -text
tests/FunctionalTests/active-controls/protected/pages/report.gif -text
tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php -text
+tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php -text
tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php -text
tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php -text
tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php -text
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 @@
+<com:TForm ID="form1">
+ <h1>Active HiddenField Test Case</h1>
+
+ <com:TActiveHiddenField ID="HiddenFieldEmpty" />
+ <com:TActiveHiddenField ID="HiddenFieldUsed" Value="My value" />
+
+ <div>
+ <com:TActiveButton ID="Button1" Text="Set value to HiddenFieldEmpty" OnClick="onSetValue" />
+ <com:TActiveButton ID="Button2" Text="Get value from HiddenFieldUsed" OnClick="onGetValue" />
+ <com:TActiveButton ID="Button3" Text="Get values from both fields" OnClick="onGetBothValues" />
+ </div>
+ <div>
+ <com:TActiveLabel ID="ResponseLabel" Text="Value of current hidden field" />
+ </div>
+ <com:TJavascriptLogger />
+</com:TForm> \ 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 @@
+<?php
+
+class ActiveHiddenFieldTest extends TPage
+{
+ public function onSetValue($sender, $param)
+ {
+ $this->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 @@
+<?php
+
+class ActiveHiddenFieldTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->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