From 817da66e1cb3548f728db9ff4a96e783ed7522b5 Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 22 Jun 2006 11:55:46 +0000 Subject: Update callback adapter --- .../protected/pages/ControlAdapterTest.page | 23 +++++++++ .../protected/pages/ControlAdapterTest.php | 58 ++++++++++++++++++++++ .../tests/CallbackAdapterTestCase.php | 32 ++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php create mode 100644 tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page new file mode 100644 index 00000000..f0f3044d --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page @@ -0,0 +1,23 @@ + +

Control Adapter - State Tracking Tests

+ + + +
+ + +
+ + + +
+ + +
+ + +
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php new file mode 100644 index 00000000..edaf0720 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php @@ -0,0 +1,58 @@ +button1->Enabled = !$this->button1->Enabled; + } + + function change_visible() + { + $this->button1->Visible = !$this->button1->Visible; + } + + function change_tooltip() + { + $this->button1->ToolTip = "hello world"; + } + + function change_tabindex() + { + $this->button1->tabIndex = 10; + } + + function change_accesskey() + { + $this->button1->accessKey = "F"; + } + + function change_bgcolor1() + { + $this->button1->BackColor = "orange"; + $this->button1->ForeColor="white"; + $this->button1->Font->Bold = true; + $this->button1->Font->Size = "2em"; + } + + + function change_bgcolor2() + { + $this->button2->BackColor = "red"; + $this->button2->ForeColor="white"; + $this->button2->Font->Bold = true; + $this->button2->Font->Size = 14; + } + + function change_attributes1() + { + $this->button1->Attributes['onclick'] = "alert('haha!')"; + } + + function change_attributes2() + { + $this->button2->Attributes['onclick'] = "alert('baz!')"; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php new file mode 100644 index 00000000..3a3b292c --- /dev/null +++ b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php @@ -0,0 +1,32 @@ +open("active-controls/index.php?page=ControlAdapterTest"); + $this->assertTextPresent('Control Adapter - State Tracking Tests'); + + $this->click('button2'); + $this->assertAlert('ok'); + + $this->click('test6'); + $this->pause(500); + $this->click('test7'); + $this->pause(500); + $this->click('test8'); + $this->pause(500); + $this->click('test9'); + $this->pause(500); + + $this->click('button1'); + $this->assertAlert('haha!'); + + $this->click('button2'); + $this->assertAlert('ok'); + $this->assertAlert('baz!'); + + } +} + +?> \ No newline at end of file -- cgit v1.2.3