From 1180e6486139a9c9662984367c4f624394e06f35 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Sat, 12 Aug 2006 12:54:27 +0000
Subject: Add Triggered Callbacks
---
.../protected/pages/CallbackTimerTest.page | 21 ---------------
.../protected/pages/CallbackTimerTest.php | 27 -------------------
.../protected/pages/EventTriggeredCallback.page | 31 ++++++++++++++++++++++
.../protected/pages/EventTriggeredCallback.php | 21 +++++++++++++++
.../protected/pages/PeriodicCallbackTest.page | 21 +++++++++++++++
.../protected/pages/PeriodicCallbackTest.php | 27 +++++++++++++++++++
.../protected/pages/ValueTriggerCallbackTest.page | 14 ++++++++++
.../protected/pages/ValueTriggerCallbackTest.php | 12 +++++++++
.../tests/CallbackTimerTestCase.php | 21 ---------------
.../active-controls/tests/EventTriggerTestCase.php | 22 +++++++++++++++
.../tests/PeriodicCallbackTestCase.php | 21 +++++++++++++++
.../tests/ValueTriggerCallbackTestCase.php | 22 +++++++++++++++
12 files changed, 191 insertions(+), 69 deletions(-)
delete mode 100644 tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page
delete mode 100644 tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.php
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page
create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php
delete mode 100644 tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php
create mode 100644 tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php
create mode 100644 tests/FunctionalTests/active-controls/tests/PeriodicCallbackTestCase.php
create mode 100644 tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php
(limited to 'tests/FunctionalTests/active-controls')
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page
deleted file mode 100644
index 8e99e528..00000000
--- a/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.page
+++ /dev/null
@@ -1,21 +0,0 @@
-
- TCallbackTimer + ViewState Tests
-
-
-
-
-
-
-
-
-
- Loading...
-
-
-
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php b/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php
deleted file mode 100644
index da87ac0f..00000000
--- a/tests/FunctionalTests/active-controls/protected/pages/CallbackTimerTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-timer1->startTimer();
- $this->setViewState('count', 0);
- }
-
- function stop_timer($sender, $param)
- {
- $this->timer1->stopTimer();
- }
-
- function tick($sender, $param)
- {
- $count = intval($this->getViewState('count'));
- $this->setViewState('count', ++$count);
- if($count > 10)
- $this->timer1->stopTimer();
- else
- $this->label1->Text .= " ".$count;
- }
-}
-
-?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page
new file mode 100644
index 00000000..889636f3
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page
@@ -0,0 +1,31 @@
+
+
+ Event Triggered Callback Test
+
+
+
+
+ Mouse over this panel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.php b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.php
new file mode 100644
index 00000000..dc47d867
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.php
@@ -0,0 +1,21 @@
+label1->Text = 'text 1 focused';
+ }
+
+ function panel1_onmouseover($sender, $param)
+ {
+ $this->label1->Text = 'panel 1 on mouse over '.time();
+ }
+
+ function button1_clicked($sender, $param)
+ {
+ $this->label1->Text = 'button 1 clicked';
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page
new file mode 100644
index 00000000..bbc12862
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page
@@ -0,0 +1,21 @@
+
+ TPeriodicCallback + ViewState Tests
+
+
+
+
+
+
+
+
+
+ Loading...
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php b/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php
new file mode 100644
index 00000000..13633a00
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php
@@ -0,0 +1,27 @@
+timer1->startTimer();
+ $this->setViewState('count', 0);
+ }
+
+ function stop_timer($sender, $param)
+ {
+ $this->timer1->stopTimer();
+ }
+
+ function tick($sender, $param)
+ {
+ $count = intval($this->getViewState('count'));
+ $this->setViewState('count', ++$count);
+ if($count > 10)
+ $this->timer1->stopTimer();
+ else
+ $this->label1->Text .= " ".$count;
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page
new file mode 100644
index 00000000..1281cc5c
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.page
@@ -0,0 +1,14 @@
+
+Value Trigger Callback Test
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php
new file mode 100644
index 00000000..c3c44252
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php
@@ -0,0 +1,12 @@
+getParameter();
+ $this->label1->Text = "Old = ".$values->OldValue." : New Value = ".$values->NewValue;
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php
deleted file mode 100644
index 2954cc51..00000000
--- a/tests/FunctionalTests/active-controls/tests/CallbackTimerTestCase.php
+++ /dev/null
@@ -1,21 +0,0 @@
-open("active-controls/index.php?page=CallbackTimerTest");
- $this->verifyTextPresent("TCallbackTimer + ViewState Tests");
-
- $this->assertText("label1", "ViewState Counter :");
-
- $this->click("button1");
-
- $this->pause(8000);
-
- $this->assertText("label1", "ViewState Counter : 1 2 3 4 5 6 7 8 9 10");
-
- }
-}
-
-?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php
new file mode 100644
index 00000000..8e400b5b
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php
@@ -0,0 +1,22 @@
+open("active-controls/index.php?page=EventTriggeredCallback");
+ $this->verifyTextPresent("Event Triggered Callback Test");
+
+ $this->assertText('label1', 'Label 1');
+
+ $this->click('button1');
+ $this->pause(800);
+ $this->assertText('label1', 'button 1 clicked');
+
+ $this->type('text1', 'test');
+ $this->pause(800);
+ $this->assertText('label1', 'text 1 focused');
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/PeriodicCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/PeriodicCallbackTestCase.php
new file mode 100644
index 00000000..2468aebf
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/PeriodicCallbackTestCase.php
@@ -0,0 +1,21 @@
+open("active-controls/index.php?page=PeriodicCallbackTest");
+ $this->verifyTextPresent("TPeriodicCallback + ViewState Tests");
+
+ $this->assertText("label1", "ViewState Counter :");
+
+ $this->click("button1");
+
+ $this->pause(8000);
+
+ $this->assertText("label1", "ViewState Counter : 1 2 3 4 5 6 7 8 9 10");
+
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php
new file mode 100644
index 00000000..f98fc4a8
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php
@@ -0,0 +1,22 @@
+open("active-controls/index.php?page=ValueTriggerCallbackTest");
+ $this->verifyTextPresent("Value Trigger Callback Test");
+
+ $this->assertText('label1', 'Label 1');
+
+ $this->type('text1', 'test');
+ $this->pause(2000);
+ $this->assertText('label1', 'Old = : New Value = test');
+
+ $this->type('text1', 'more');
+ $this->pause(3000);
+ $this->assertText('label1', 'Old = test : New Value = more');
+ }
+}
+
+?>
\ No newline at end of file
--
cgit v1.2.3