summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests
diff options
context:
space:
mode:
authorwei <>2006-08-27 04:18:31 +0000
committerwei <>2006-08-27 04:18:31 +0000
commit887da1b3668499821f046665b461aeadb0a9fb2e (patch)
tree776f742ea179c823c90e7b81d2262a4344610eca /tests/FunctionalTests
parent1180e6486139a9c9662984367c4f624394e06f35 (diff)
Adding TActiveImage and TActiveImageButton
Diffstat (limited to 'tests/FunctionalTests')
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page10
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php7
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page24
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php31
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php2
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php10
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php2
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php2
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page (renamed from tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page)6
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.php (renamed from tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php)2
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/group.gifbin0 -> 606 bytes
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/report.gifbin0 -> 402 bytes
-rw-r--r--tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php17
-rw-r--r--tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php (renamed from tests/FunctionalTests/active-controls/tests/PeriodicCallbackTestCase.php)6
14 files changed, 98 insertions, 21 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
index c475f17f..2e192c19 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.page
@@ -1,11 +1,11 @@
<com:TForm ID="form1">
-
+
<h1>TActiveButton Functional Test</h1>
- <com:TActiveButton ID="button2" Text="Button 1"
+ <com:TActiveButton ID="button2" Text="Button 1"
OnClick="button2_onclick" OnCallback="button2_oncallback" />
-
+
<com:TActiveLabel ID="label1" Text="Label 1" />
-
+
<com:TJavascriptLogger />
-
+
</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php
index 6282b804..42322ea1 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveButtonTest.php
@@ -2,11 +2,16 @@
class ActiveButtonTest extends TPage
{
+ function onLoad($param)
+ {
+ new TActiveButton;
+ }
+
function button2_onclick($sender, $param)
{
$this->label1->Text = "Button 1 was clicked ";
}
-
+
function button2_oncallback($sender, $param)
{
$this->label1->Text .= "using callback!";
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page
new file mode 100644
index 00000000..7696261a
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page
@@ -0,0 +1,24 @@
+<com:TForm ID="form1">
+
+ <h1>TActiveImageButton Functional Test</h1>
+
+ This is
+ <com:TActiveImageButton
+ ID="image1"
+ ImageUrl=<%~ report.gif %> OnClick="image1_clicked" />
+ an image.
+
+ <div style="border:1px solid #ccc; padding:1em; border:1em">
+ <com:TActiveLabel ID="label1" Text="Label 1" />
+ </div>
+
+ <com:TActiveButton ID="button1" Text="Change Text" OnClick="change_text" />
+ <com:TActiveButton ID="button2" Text="Change Image"
+ CustomData=<%~ group.gif %>
+ OnClick="change_image" />
+ <com:TActiveButton ID="button3" Text="Change Align" OnClick="change_align" />
+ <com:TActiveButton ID="button4" Text="Change Description" OnClick="change_description" />
+
+ <com:TJavascriptLogger />
+
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php
new file mode 100644
index 00000000..eced2457
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.php
@@ -0,0 +1,31 @@
+<?php
+
+class ActiveImageButtonTest extends TPage
+{
+ function change_text($sender, $param)
+ {
+ $this->image1->AlternateText = "Muahahahah";
+ }
+
+ function change_image($sender, $param)
+ {
+ $this->image1->ImageUrl = $sender->CustomData;
+ }
+
+ function change_align($sender, $param)
+ {
+ $this->image1->ImageAlign="absbottom";
+ }
+
+ function change_description($sender, $param)
+ {
+ $this->image1->DescriptionUrl = "maahahhaa";
+ }
+
+ function image1_clicked($sender, $param)
+ {
+ $this->label1->Text = "Image clicked at x={$param->x}, y={$param->y}";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php
index 8a0a4316..b29f8920 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActivePanelTest.php
@@ -5,7 +5,7 @@ class ActivePanelTest extends TPage
function callback1_requested($sender, $param)
{
$this->content1->visible = true;
- $this->panel1->render($param->output);
+ $this->panel1->render($param->NewWriter);
}
}
diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
index df314891..21f61abe 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
@@ -9,15 +9,15 @@ class AutoCompleteTest extends TPage
{
$sender->setDataSource($this->matchCountries($param->getParameter()));
$sender->dataBind();
- $sender->flush($param->getOutput());
+ $sender->render($param->getNewWriter());
$this->label1->Text = "suggestion for ".$param->getParameter();
}
-
+
public function callback_requested($sender, $param)
{
$this->label1->Text = "Label 1: ".$this->textbox3->Text;
}
-
+
protected function matchCountries($token)
{
$info = Prado::createComponent('System.I18N.core.CultureInfo', 'en');
@@ -31,9 +31,9 @@ class AutoCompleteTest extends TPage
$list[] = $country;
$count++;
if($count > 10) break;
- }
+ }
}
- return $list;
+ return $list;
}
}
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php
index 753de25c..18005a2b 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php
@@ -16,7 +16,7 @@ class CustomTemplateControlTest extends TPage
function button2_callback($sender, $param)
{
- $this->placeholder->render($param->output);
+ $this->placeholder->render($param->NewWriter);
$this->label1->Text .= " using callback!";
$this->label1->Text .= "... and this is the textbox text: ". $this->foo->Text;
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php
index 4c6190ee..76b77ff7 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/NestedActiveControls.php
@@ -5,7 +5,7 @@ class NestedActiveControls extends TPage
function callback1_requested($sender, $param)
{
$this->content1->visible = true;
- $this->panel1->render($param->output);
+ $this->panel1->render($param->NewWriter);
}
function button1_clicked($sender, $param)
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page
index bbc12862..36b3bc05 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.page
@@ -1,15 +1,15 @@
<com:TForm ID="form1">
- <h1>TPeriodicCallback + ViewState Tests</h1>
+ <h1>TTimeTriggeredCallback + ViewState Tests</h1>
<com:TActiveButton id="button1" Text="Start Timer" OnCallback="start_timer" />
<com:TActiveButton Text="Stop Timer" OnCallback="stop_timer" />
<div style="margin:1em; padding:1em; border:1px solid #ccc;">
<com:TActiveLabel ID="label1" Text="ViewState Counter : " />
</div>
- <com:TPeriodicCallback ID="timer1" Interval="0.1" OnCallback="tick">
+ <com:TTimeTriggeredCallback ID="timer1" Interval="0.1" OnCallback="tick">
<prop:ActiveControl.ClientSide
OnLoading="$('status').show()"
OnComplete="$('status').hide()" />
- </com:TPeriodicCallback>
+ </com:TTimeTriggeredCallback>
<div id="status" style="margin:1em; padding:0.5em;
text-align:center;
background-color:#900;
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.php
index 13633a00..788857f8 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/PeriodicCallbackTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/TimeTriggeredCallbackTest.php
@@ -1,6 +1,6 @@
<?php
-class PeriodicCallbackTest extends TPage
+class TimeTriggeredCallbackTest extends TPage
{
function start_timer($sender, $param)
{
diff --git a/tests/FunctionalTests/active-controls/protected/pages/group.gif b/tests/FunctionalTests/active-controls/protected/pages/group.gif
new file mode 100644
index 00000000..89c577f7
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/group.gif
Binary files differ
diff --git a/tests/FunctionalTests/active-controls/protected/pages/report.gif b/tests/FunctionalTests/active-controls/protected/pages/report.gif
new file mode 100644
index 00000000..f7169762
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/report.gif
Binary files differ
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php
new file mode 100644
index 00000000..3d9937bd
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php
@@ -0,0 +1,17 @@
+<?php
+
+class ActiveImageButtonTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open("active-controls/index.php?page=ActiveImageButtonTest");
+ $this->assertTextPresent("TActiveImageButton Functional Test");
+ $this->assertText("label1", "Label 1");
+ $this->click("image1");
+ $this->pause(800);
+ //unable to determine mouse position
+ $this->assertTextPresent("Image clicked at x=0, y=0");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/PeriodicCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php
index 2468aebf..675e3311 100644
--- a/tests/FunctionalTests/active-controls/tests/PeriodicCallbackTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php
@@ -1,11 +1,11 @@
<?php
-class PeriodicCallbackTestCase extends SeleniumTestCase
+class TimeTriggeredCallbackTestCase extends SeleniumTestCase
{
function test()
{
- $this->open("active-controls/index.php?page=PeriodicCallbackTest");
- $this->verifyTextPresent("TPeriodicCallback + ViewState Tests");
+ $this->open("active-controls/index.php?page=TimeTriggeredCallbackTest");
+ $this->verifyTextPresent("TimeTriggeredCallback + ViewState Tests");
$this->assertText("label1", "ViewState Counter :");