From 6bc7f2812ec16d5b46e2b75b1ae5172f7f778bcf Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 16 Sep 2006 01:09:33 +0000 Subject: Test for ticket #364 --- .../protected/pages/PostLoadingTest.page | 24 ++++++++++++ .../protected/pages/PostLoadingTest.php | 44 ++++++++++++++++++++++ .../active-controls/tests/PostLoadingTestCase.php | 22 +++++++++++ 3 files changed, 90 insertions(+) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php create mode 100644 tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php (limited to 'tests/FunctionalTests/active-controls') diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page new file mode 100644 index 00000000..6dd58d48 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page @@ -0,0 +1,24 @@ + + +

PostLoading Test

+ + + + +
+ Click Me! +
+ + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php new file mode 100644 index 00000000..a8c409e7 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php @@ -0,0 +1,44 @@ +setVisible(false); + $textBox->setID("MyTextBox"); + $this->panel1->getControls()->add($textBox); + $this->registerObject("MyTextBox", $textBox); + + + // Submit button + $button=new TActiveButton(); + $button->setVisible(false); + $button->setID("MyButton"); + $button->setText("Submit"); + $button->attachEventHandler("OnCallback", array($this, "clickedButton")); + $this->panel1->getControls()->add($button); + $this->registerObject("MyButton", $button); + + } + + + function callback1_requested($sender, $param) + { + $this->MyTextBox->visible = true; + $this->MyButton->ActiveControl->EnableUpdate=false; + $this->MyButton->visible = true; + $this->panel1->render($param->NewWriter); + } + + function clickedButton($sender, $param) + { + $this->panel1->getControls()->add('Result is '.$this->MyTextBox->getText()); + $this->panel1->render($param->NewWriter); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php new file mode 100644 index 00000000..3b4d0ce9 --- /dev/null +++ b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php @@ -0,0 +1,22 @@ +open('active-controls/index.php?page=PostLoadingTest'); + $this->assertTextPresent('PostLoading Test'); + + $this->assertTextNotPresent('Hello World'); + + $this->click('div1'); + $this->pause(800); + $this->type('MyTextBox', 'Hello World'); + $this->click('MyButton'); + + $this->pause(800); + $this->assertTextPresent('Result is Hello World'); + } +} + +?> \ No newline at end of file -- cgit v1.2.3