From 9afa1445890254e867dd172a36f42484aec8916b Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 28 Jun 2006 18:23:52 +0000 Subject: merge from 3.0 branch till 1208. --- .../quickstart/Controls/PagerTestCase.php | 58 ++++++++++++++++++++++ .../tickets/protected/pages/Ticket239.page | 19 +++++++ .../tickets/protected/pages/Ticket239.php | 16 ++++++ .../tickets/tests/Ticket239TestCase.php | 55 ++++++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 tests/FunctionalTests/quickstart/Controls/PagerTestCase.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket239.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket239.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket239TestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php new file mode 100644 index 00000000..2ecb3452 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php @@ -0,0 +1,58 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TPager.Sample1&notheme=true", ""); + + // verify datalist content + $this->verifyTextPresent('ITN001',''); + $this->verifyTextPresent('ITN002',''); + $this->verifyTextNotPresent('ITN003',''); + + // verify numeric paging + $this->clickAndWait("ctl0_body_Pager_ctl1", ""); // 2nd page + $this->verifyTextPresent('ITN003',''); + $this->verifyTextPresent('ITN004',''); + $this->verifyTextNotPresent('ITN002',''); + $this->verifyTextNotPresent('ITN005',''); + $this->clickAndWait("ctl0_body_Pager_ctl3", ""); // 4rd page + $this->verifyTextPresent('ITN007',''); + $this->verifyTextPresent('ITN008',''); + $this->verifyTextNotPresent('ITN006',''); + $this->verifyTextNotPresent('ITN009',''); + $this->clickAndWait("ctl0_body_Pager_ctl6", ""); // last page + $this->verifyTextPresent('ITN019',''); + $this->verifyTextNotPresent('ITN018',''); + $this->verifyTextNotPresent('ITN001',''); + + // verify next-prev paging + $this->clickAndWait("ctl0_body_Pager2_ctl1", ""); // prev page + $this->verifyTextPresent('ITN017',''); + $this->verifyTextPresent('ITN018',''); + $this->verifyTextNotPresent('ITN019',''); + $this->verifyTextNotPresent('ITN016',''); + $this->clickAndWait("ctl0_body_Pager2_ctl0", ""); // first page + $this->verifyTextPresent('ITN001',''); + $this->verifyTextPresent('ITN002',''); + $this->verifyTextNotPresent('ITN003',''); + $this->clickAndWait("ctl0_body_Pager2_ctl2", ""); // next page + $this->verifyTextPresent('ITN003',''); + $this->verifyTextPresent('ITN004',''); + $this->verifyTextNotPresent('ITN002',''); + $this->verifyTextNotPresent('ITN005',''); + + $this->verifySelected("ctl0_body_Pager3_ctl0","label=2"); + $this->selectAndWait("ctl0_body_Pager3_ctl0", "label=5"); + $this->verifyTextPresent('ITN009',''); + $this->verifyTextPresent('ITN010',''); + $this->verifyTextNotPresent('ITN008',''); + $this->verifyTextNotPresent('ITN011',''); + $this->selectAndWait("ctl0_body_Pager3_ctl0", "label=10"); + $this->verifyTextPresent('ITN019',''); + $this->verifyTextNotPresent('ITN018',''); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket239.page b/tests/FunctionalTests/tickets/protected/pages/Ticket239.page new file mode 100644 index 00000000..a67c38a8 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket239.page @@ -0,0 +1,19 @@ + + + + + view1 + + + + view2 + + + + + view3 + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket239.php b/tests/FunctionalTests/tickets/protected/pages/Ticket239.php new file mode 100644 index 00000000..a40c94b5 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket239.php @@ -0,0 +1,16 @@ +Result->Text.=$sender->ID." is activated. "; + } + + public function deactivateView($sender,$param) + { + $this->Result->Text.=$sender->ID." is deactivated. "; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php new file mode 100644 index 00000000..9d895cb4 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php @@ -0,0 +1,55 @@ +open('tickets/index.php?page=Ticket239'); + + // view1 + $this->verifyTextPresent('view1 is activated',''); + $this->verifyTextNotPresent('view1 is deactivated',''); + $this->verifyTextNotPresent('view2 is activated',''); + $this->verifyTextNotPresent('view2 is deactivated',''); + $this->verifyTextNotPresent('view3 is activated',''); + $this->verifyTextNotPresent('view3 is deactivated',''); + + // goto view2 + $this->clickAndWait('name=ctl0$Content$ctl1'); + $this->verifyTextNotPresent('view1 is activated',''); + $this->verifyTextPresent('view1 is deactivated',''); + $this->verifyTextPresent('view2 is activated',''); + $this->verifyTextNotPresent('view2 is deactivated',''); + $this->verifyTextNotPresent('view3 is activated',''); + $this->verifyTextNotPresent('view3 is deactivated',''); + + // goto view3 + $this->clickAndWait('name=ctl0$Content$ctl3'); + $this->verifyTextNotPresent('view1 is activated',''); + $this->verifyTextNotPresent('view1 is deactivated',''); + $this->verifyTextNotPresent('view2 is activated',''); + $this->verifyTextPresent('view2 is deactivated',''); + $this->verifyTextPresent('view3 is activated',''); + $this->verifyTextNotPresent('view3 is deactivated',''); + + // goto view2 + $this->clickAndWait('name=ctl0$Content$ctl4'); + $this->verifyTextNotPresent('view1 is activated',''); + $this->verifyTextNotPresent('view1 is deactivated',''); + $this->verifyTextPresent('view2 is activated',''); + $this->verifyTextNotPresent('view2 is deactivated',''); + $this->verifyTextNotPresent('view3 is activated',''); + $this->verifyTextPresent('view3 is deactivated',''); + + // goto view1 + $this->clickAndWait('name=ctl0$Content$ctl2'); + $this->verifyTextPresent('view1 is activated',''); + $this->verifyTextNotPresent('view1 is deactivated',''); + $this->verifyTextNotPresent('view2 is activated',''); + $this->verifyTextPresent('view2 is deactivated',''); + $this->verifyTextNotPresent('view3 is activated',''); + $this->verifyTextNotPresent('view3 is deactivated',''); + } +} + +?> \ No newline at end of file -- cgit v1.2.3