From 96c0b5c35463387664db3fa69898d54a929eaa2a Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 30 Mar 2007 07:11:11 +0000 Subject: Fixed #538 --- .../tickets/protected/pages/Ticket538.page | 25 +++++ .../tickets/protected/pages/Ticket538.php | 102 +++++++++++++++++++++ .../tickets/protected/pages/Ticket542.page | 16 ++++ .../tickets/protected/pages/Ticket542.php | 23 +++++ .../tickets/tests/Ticket538TestCase.php | 30 ++++++ 5 files changed, 196 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket538.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket538.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket542.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket542.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket538TestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket538.page b/tests/FunctionalTests/tickets/protected/pages/Ticket538.page new file mode 100644 index 00000000..80ab5ff0 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket538.page @@ -0,0 +1,25 @@ + + + + + + + + + + + + + +
+ + +
$Id: Home.page 1650 2007-01-24 06:55:32Z wei $
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket538.php b/tests/FunctionalTests/tickets/protected/pages/Ticket538.php new file mode 100644 index 00000000..2ad9fd43 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket538.php @@ -0,0 +1,102 @@ +Text= $sender->ClientID . " clicked"; + } + + public function checkboxCallback($sender, $param) + { + $sender->Text .= ' using callback'; + } + + public function readData() + { + $data=array( + array('id'=>'001','name'=>'John','age'=>31), + array('id'=>'002','name'=>'Mary','age'=>30), + array('id'=>'003','name'=>'Cary','age'=>20), + array('id'=>'004','name'=>'Kevin','age'=>65), + array('id'=>'005','name'=>'Steven','age'=>10), + array('id'=>'006','name'=>'Josh','age'=>23), + array('id'=>'007','name'=>'Lary','age'=>54)); + return $data; + } + + //-------------------------------------------------------------------- + // TListBox + //-------------------------------------------------------------------- + + public function dataSelector2_Clicked($sender, $param) + { + $this->DataViewer2->DataTextField='name'; + $this->DataViewer2->Items->clear(); + foreach ($this->readData() as $index=>$person) + { + $item = new TListItem('G1: '.$person['name'].'=>'.$person['age'],$index); + $item->Attributes->Group = 'test1'; + $this->DataViewer2->Items->add($item); + } + foreach ($this->readData() as $index=>$person) + { + $item2 = new TListItem('G2: '.$person['name'].'=>'.$person['age'],$index+100); + $item2->Attributes->Group = 'test2'; + $this->DataViewer2->Items->add($item2); + } + $this->DataViewer2->dataBind(); + } + + public function selectBtn2_Clicked() + { + $text = ''; + foreach ($this->DataViewer2->SelectedIndices as $index) + { + $text .= '"'.$this->DataViewer2->Items[$index]->Attributes->Group.'", '; + } + $this->ALLog->setText($text); + } + + //-------------------------------------------------------------------- + // TActiveListBox + //-------------------------------------------------------------------- + + + public function dataSelector_Clicked($sender, $param) + { + $this->DataViewer->DataTextField='name'; + $this->DataViewer->Items->clear(); + foreach ($this->readData() as $index=>$person) + { + $item = new TListItem('G1: '.$person['name'].'=>'.$person['age'],$index); + $item->Attributes->Group = 'test1'; + $this->DataViewer->Items->add($item); + } + + foreach ($this->readData() as $index=>$person) + { + $item2 = new TListItem('G2: '.$person['name'].'=>'.$person['age'],$index+100); + $item2->Attributes->Group = 'test2'; + $this->DataViewer->Items->add($item2); + } + $this->DataViewer->dataBind(); + } + + public function selectBtn_Clicked() + { + $text = ''; + foreach ($this->DataViewer->SelectedIndices as $index) + { + if($this->DataViewer->Items[$index]->Attributes['Group']) + $text .= $index .'- "'.$this->DataViewer->Items[$index]->Attributes->Group.'", '; + else + $text .= $index.','; + } + $this->ALLog->setText($text); + } + +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket542.page b/tests/FunctionalTests/tickets/protected/pages/Ticket542.page new file mode 100644 index 00000000..5c39c6b5 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket542.page @@ -0,0 +1,16 @@ + + +
+ Some content + Test + 123 + 456 +
+
+ + + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket542.php b/tests/FunctionalTests/tickets/protected/pages/Ticket542.php new file mode 100644 index 00000000..bcd32a04 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket542.php @@ -0,0 +1,23 @@ +CallbackClient->slideUp($this->TheBox); + } + + public function blindUp($sender, $param) { + $this->CallbackClient->blindUp($this->TheBox); + } + + public function slideDown($sender, $param) { + $this->CallbackClient->slideDown($this->TheBox); + } + + public function blindDown($sender, $param) { + $this->CallbackClient->blindDown($this->TheBox); + } + +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php new file mode 100644 index 00000000..712ff24b --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket538TestCase.php @@ -0,0 +1,30 @@ +open('tickets/index.php?page=Ticket538'); + $this->verifyTitle("Verifying Ticket 538", ""); + + $this->assertText("{$base}ALLog", 'waiting for response...'); + + $this->select("{$base}DataViewer", "empty :("); + $this->click("{$base}selectBtn"); + $this->pause(800); + + $this->assertText("{$base}ALLog", '0,'); + + $this->select("{$base}DataSelector", "select data set 2"); + $this->pause(800); + $this->select("{$base}DataViewer", "G1: Steven=>10"); + $this->addSelection("{$base}DataViewer", "G2: Kevin=>65"); + + $this->click("{$base}selectBtn"); + $this->pause(800); + $this->assertText("{$base}ALLog", '4- "test1", 10- "test2",'); + } +} + +?> \ No newline at end of file -- cgit v1.2.3