From 0ee23d595c73a94fd61e486cce2f6f42b4c19fdf Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 8 May 2007 03:02:03 +0000 Subject: Fixed #587 --- .../protected/pages/Ticket587_reopened.page | 28 ++++++++++ .../tickets/protected/pages/Ticket587_reopened.php | 62 ++++++++++++++++++++++ .../tickets/tests/Ticket587TestCase.php | 26 +++++++++ 3 files changed, 116 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket587TestCase.php (limited to 'tests/FunctionalTests') diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page new file mode 100644 index 00000000..cf7d2136 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.page @@ -0,0 +1,28 @@ + + + + + + + + + + + +
+ +
+
+ + + + + + +
+ + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php new file mode 100644 index 00000000..7d24e5f6 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket587_reopened.php @@ -0,0 +1,62 @@ +label1->setText("Selection 1: ".$sender->getSelectedValue()); + $this->addOptionsToList2($sender->getSelectedValue(),$sender->getSelectedIndex()); + } + + function suggest($sender, $param) + { + $this->list2->Items->clear(); + for($i = 0; $i < 2; $i++) + $this->list2->Items[$i] = 'asd 3 - item '.($i+1); + } + + function addOptionsToList2($parent,$index) + { + $this->list2->Items->clear(); + for($i = 0; $i < 2+$index; $i++) + $this->list2->Items[$i] = $parent.' - item '.($i+1); + $this->list2->setEnabled(true); + } + + function list2_changed($sender) + { + $this->label1->setText("Selection 2: ".$sender->getSelectedValue()); + } + + function select_index_3() + { + $this->list1->setSelectedIndex(3); + } + + function clear_selections() + { + $this->list1->clearSelection(); + } + + function select_value_2() + { + $this->list1->setSelectedValue("value 2"); + } + + function select_index_3_plus() + { + $this->list1->setSelectedValue("value 3"); + $this->list1_changed($this->list1); + $this->list2->setSelectedValue("value 3 - item 3"); + } + + function do_postback() + { + $value = 'List 1: '.$this->list1->selectedValue. ', List 2: '. $this->list2->selectedValue; + $this->label1->Text = $value; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php new file mode 100644 index 00000000..f02b6a42 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php @@ -0,0 +1,26 @@ +open('tickets/index.php?page=Ticket587_reopened'); + $this->assertTitle("Verifying Ticket 587_reopened"); + + $this->assertText($base."label1", "Label 1"); + $this->select($base."list1", "item 3"); + $this->pause(800); + $this->select($base."list2", "value 3 - item 4"); + $this->pause(800); + $this->assertText($base."label1", "Selection 2: value 3 - item 4"); + + $this->keyPress($base.'text1', 't'); + $this->pause(800); + $this->select($base."list2", "asd 3 - item 2"); + $this->pause(800); + $this->assertText($base."label1", "Selection 2: asd 3 - item 2"); + } +} + +?> \ No newline at end of file -- cgit v1.2.3