From 2d88e84697fa4a36b7a2077b9e086aa2f9d3d67a Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 18 Jun 2006 06:49:29 +0000 Subject: Add ActiveCheckBox --- .../protected/pages/ActiveCheckBoxTest.page | 29 ++++++++++ .../protected/pages/ActiveCheckBoxTest.php | 32 ++++++++++++ .../tests/ActiveCheckBoxTestCase.php | 61 ++++++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.php create mode 100644 tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php (limited to 'tests/FunctionalTests/active-controls') diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page new file mode 100644 index 00000000..9ff09bb6 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page @@ -0,0 +1,29 @@ + +

Active CheckBox Test

+ + + + +
+ +
+
+ + + + + +
+ + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.php new file mode 100644 index 00000000..d762ab28 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.php @@ -0,0 +1,32 @@ +checkbox1->Text = "Hello CheckBox 1"; + } + + function change_checkbox1_checked() + { + $this->checkbox1->Checked = !$this->checkbox1->Checked; + } + + function change_checkbox2_text() + { + $this->checkbox2->Text = "CheckBox 2 World"; + } + + function change_checkbox2_checked() + { + $this->checkbox2->Checked = !$this->checkbox2->Checked; + } + + function checkbox_requested($sender, $param) + { + $this->label1->Text = "Label 1:".$sender->Text. + ($sender->checked ? ' Checked ' : ' Not Checked'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php new file mode 100644 index 00000000..30dda753 --- /dev/null +++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php @@ -0,0 +1,61 @@ +open("active-controls/index.php?page=ActiveCheckBoxTest"); + $this->verifyTextPresent("Active CheckBox Test"); + + $this->assertText("checkbox1_label", "CheckBox 1"); + $this->assertText("checkbox2_label", "CheckBox 2"); + $this->assertText('label1', 'Label 1'); + + $this->click("change_text1"); + $this->pause(500); + $this->assertText('checkbox1_label', 'Hello CheckBox 1'); + + $this->click("change_text2"); + $this->pause(500); + $this->assertText('checkbox2_label', 'CheckBox 2 World'); + + //check box 1 + $this->click('change_checked1'); + $this->pause(500); + $this->assertChecked('checkbox1'); + + $this->click('change_checked1'); + $this->pause(500); + $this->assertNotChecked('checkbox1'); + + //check box 2 + $this->click('change_checked2'); + $this->pause(500); + $this->assertChecked('checkbox2'); + + $this->click('change_checked2'); + $this->pause(500); + $this->assertNotChecked('checkbox2'); + + //click checkbox 1 + $this->click("checkbox1"); + $this->pause(500); + $this->assertText("label1", "Label 1:Hello CheckBox 1 Checked"); + + $this->click("checkbox1"); + $this->pause(500); + $this->assertText("label1", "Label 1:Hello CheckBox 1 Not Checked"); + + //click checkbox 2 + $this->click("checkbox2"); + $this->pause(500); + $this->assertText("label1", "Label 1:CheckBox 2 World Checked"); + + $this->click("checkbox2"); + $this->pause(500); + $this->assertText("label1", "Label 1:CheckBox 2 World Not Checked"); + + } +} + +?> \ No newline at end of file -- cgit v1.2.3