summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets
diff options
context:
space:
mode:
authorwei <>2007-03-30 05:04:30 +0000
committerwei <>2007-03-30 05:04:30 +0000
commit4f968c045e0d09ab3e4f659743effb5305a963ce (patch)
tree58d5cb87db43ba87c0a559d411e9d36aa0bd7f3c /tests/FunctionalTests/tickets
parent70744a98444df0583d76f19d4e399a5cc49349b7 (diff)
Fixed #507 and update other active controls.
Diffstat (limited to 'tests/FunctionalTests/tickets')
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket507.page29
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket507.php25
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket507TestCase.php27
3 files changed, 81 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket507.page b/tests/FunctionalTests/tickets/protected/pages/Ticket507.page
new file mode 100644
index 00000000..f80dea44
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket507.page
@@ -0,0 +1,29 @@
+<com:TContent ID="Content">
+
+ <com:TActiveListBox ID="list1"
+ Enabled="false"
+ OnCallback="list1_callback">
+ <com:TListItem Value="value 1" Text="item 1" />
+ <com:TListItem Value="value 2" Text="item 2" />
+ <com:TListItem Value="value 3" Text="item 3" />
+ <com:TListItem Value="value 4" Text="item 4" />
+ <com:TListItem Value="value 5" Text="item 5" />
+ </com:TActiveListBox>
+
+ <com:TActiveLabel ID="label1" Text="Label 1" />
+
+ <com:TActiveButton Text="Enable it" id="button1" onClick="enable_list" />
+
+<div>
+<pre>
+ SelectionMode="Multiple"
+ --&gt; this doesn't work Enabled="false"
+ --&gt; enable selection in code but
+ --&gt; getSelectedValues returns Null
+ --&gt; enabled and disbaled dynamically doesn't solved the
+ --&gt; problem either.
+</pre>
+</div>
+
+</com:TContent>
+
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket507.php b/tests/FunctionalTests/tickets/protected/pages/Ticket507.php
new file mode 100644
index 00000000..94cd8aed
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket507.php
@@ -0,0 +1,25 @@
+<?php
+
+Prado::using('System.Web.UI.ActiveControls.*');
+class Ticket507 extends TPage
+{
+
+ public function onLoad($s)
+ {
+ //the following fixed the static declaration on the above
+ $this->list1->SelectionMode="Multiple";
+ }
+
+ function list1_callback($sender, $param)
+ {
+ $values = $sender->getSelectedValues();
+ $this->label1->setText("Selection: ".implode(', ', $values));
+ }
+
+ function enable_list()
+ {
+ $this->list1->enabled = true;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php
new file mode 100644
index 00000000..e8ddbfce
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket507TestCase.php
@@ -0,0 +1,27 @@
+<?php
+
+class Ticket507TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base='ctl0_Content_';
+ $this->open('tickets/index.php?page=Ticket507');
+ $this->verifyTitle("Verifying Ticket 507", "");
+
+ $this->assertText("{$base}label1", "Label 1");
+
+ $this->click("{$base}button1");
+ $this->pause(800);
+
+ $this->select("{$base}list1", "item 1");
+ $this->pause(800);
+ $this->assertText("{$base}label1", "Selection: value 1");
+
+ $this->addSelection("{$base}list1", "item 3");
+
+ $this->pause(800);
+ $this->assertText("{$base}label1", "Selection: value 1, value 3");
+ }
+}
+
+?> \ No newline at end of file