summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-05-24 14:59:37 +0000
committerxue <>2006-05-24 14:59:37 +0000
commit9e8c47274843d78b68bf3515d26d78438e725528 (patch)
treeb1e3589628d61942f685d93fba49e3e2cf04469c
parent2f02ab8fcbb5f45bb92cb9546c0328769c290049 (diff)
Added test case for #191.
-rw-r--r--.gitattributes3
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket191.page19
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket191.php22
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket191TestCase.php16
4 files changed, 60 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index fc3e6cd1..6d0c51dd 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1047,6 +1047,8 @@ tests/FunctionalTests/tickets/protected/pages/Layout.php -text
tests/FunctionalTests/tickets/protected/pages/Layout.tpl -text
tests/FunctionalTests/tickets/protected/pages/Ticket121.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket121.php -text
+tests/FunctionalTests/tickets/protected/pages/Ticket191.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket191.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket21.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket21.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket27.page -text
@@ -1061,6 +1063,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket93.php -text
tests/FunctionalTests/tickets/protected/pages/config.xml -text
tests/FunctionalTests/tickets/protected/pages/hotspot.jpg -text
tests/FunctionalTests/tickets/tests/Ticket121TestCase.php -text
+tests/FunctionalTests/tickets/tests/Ticket191TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket21TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket27TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket54TestCase.php -text
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket191.page b/tests/FunctionalTests/tickets/protected/pages/Ticket191.page
new file mode 100644
index 00000000..2d673b8d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket191.page
@@ -0,0 +1,19 @@
+<com:TContent ID="Content">
+
+Global state:
+<com:TTextBox ID="TextBox2" />
+<com:TButton Text="Submit" OnClick="updateGlobal" />
+
+<br/>
+
+Your input:
+<com:TTextBox ID="TextBox" />
+<com:TButton Text="Submit" ValidationGroup="Foo" OnClick="buttonClicked" />
+<com:TCustomValidator
+ ValidationGroup="Foo"
+ ControlToValidate="TextBox"
+ Text="Your input must match the global state."
+ OnServerValidate="customValidation" />
+<br/>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket191.php b/tests/FunctionalTests/tickets/protected/pages/Ticket191.php
new file mode 100644
index 00000000..61c2a253
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket191.php
@@ -0,0 +1,22 @@
+<?php
+
+class Ticket191 extends TPage
+{
+ public function buttonClicked($sender,$param)
+ {
+ if($this->IsValid)
+ $this->Application->clearGlobalState('ticket190');
+ }
+
+ public function customValidation($sender,$param)
+ {
+ $param->IsValid=$this->Application->getGlobalState('ticket190')===$this->TextBox->Text;
+ }
+
+ public function updateGlobal($sender,$param)
+ {
+ $this->Application->setGlobalState('ticket190',$this->TextBox2->Text);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php
new file mode 100644
index 00000000..cc4c1571
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php
@@ -0,0 +1,16 @@
+<?php
+
+class Ticket191TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Ticket191');
+ $this->type("ctl0\$Content\$TextBox2", "test");
+ $this->clickAndWait("//input[@type='submit' and @name='ctl0\$Content\$ctl0']", "");
+ $this->type("ctl0\$Content\$TextBox", "test");
+ $this->clickAndWait("//input[@type='submit' and @name='ctl0\$Content\$ctl1']", "");
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ }
+}
+
+?> \ No newline at end of file