summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests')
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page8
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php4
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php15
-rw-r--r--tests/FunctionalTests/index.php2
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Issue120.page13
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Issue120.php22
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Layout.php17
-rw-r--r--tests/FunctionalTests/tickets/tests/Issue120TestCase.php21
8 files changed, 96 insertions, 6 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
index ed35293e..64f37867 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
@@ -11,6 +11,14 @@
<com:TActiveButton ID="increaseButton" OnClick="increase" Text="+1" OnCallback="testDatePicker"/>
<com:TButton ID="toggleButton" OnClick="toggleMode" Text="Toggle input mode (postback)"/>
</p>
+<p>
+ShowCalendar=false
+</p>
+<p>
+<com:TActiveDatePicker ID="datepicker2" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker2" InputMode="DropDownList" ShowCalendar="false"/>
+<com:TActiveLabel ID="status2" /><br/>
+</p>
+
</com:TForm>
</body>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php
index 6d78a664..4897a146 100755
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php
@@ -14,6 +14,10 @@ class ActiveDatePicker extends TPage {
$this->status->Text = $this->datepicker->getText();
}
+ public function testDatePicker2($sender, $param){
+ $this->status2->Text = $this->datepicker2->getText();
+ }
+
public function today ($sender, $param)
{
$this->datepicker->setTimestamp(time());
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
index b8e9594e..5faee611 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
@@ -35,7 +35,7 @@ class ActiveDatePickerTestCase extends SeleniumTestCase
$this->verifyText("status", date('m-d-Y', strtotime('+1 month')));
$this->click('toggleButton');
- $this->pause(1000);
+ $this->pause(2000);
$this->click("todayButton");
$this->pause(800);
@@ -91,6 +91,19 @@ class ActiveDatePickerTestCase extends SeleniumTestCase
$this->verifySelected("datepicker_day", date('d', $dateToCheck));
$this->verifySelected("datepicker_year", date('Y', $dateToCheck));
$this->verifyText("status", date('m-d-Y', $dateToCheck));
+
+ $this->click('ctl1');
+ $this->pause(800);
+
+ $this->verifyText("status2", "");
+ $dateToCheck=time();
+ $this->verifySelected("datepicker2_month", date('m', $dateToCheck));
+ $this->verifySelected("datepicker2_day", date('d', $dateToCheck));
+ $this->verifySelected("datepicker2_year", date('Y', $dateToCheck));
+ $this->select("datepicker2_year", 2005);
+ $this->pause(800);
+ $dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), 2005);
+ $this->verifyText("status2", date('m-d-Y', $dateToCheck));
}
}
diff --git a/tests/FunctionalTests/index.php b/tests/FunctionalTests/index.php
index 319ca3dc..128e80e3 100644
--- a/tests/FunctionalTests/index.php
+++ b/tests/FunctionalTests/index.php
@@ -10,7 +10,7 @@ Prado Functional Test Suites
<li><a href="quickstart.php">Tests of QuickStart Tutorial Demo</a></li>
<li><a href="validators.php">Tests of Validators</a> (<a href="validators/index.php">list of test samples</a>)</li>
<li><a href="active.php">Tests of Active Controls</a> (<a href="active-controls/index.php">list of test samples</a>) </li>
- <li><a href="tickets.php">Tests of Trac Tickets</a> (<a href="tickets/index.php">list of Test Samples</a>)</li>
+ <li><a href="tickets.php">Tests of Trac Tickets and Goggle Code Issues</a> (<a href="tickets/index.php">list of Test Samples</a>)</li>
<li><a href="features.php">Tests of New Features</a> (<a href="features/index.php">list of new features</a>)</li>
</ul>
</body>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Issue120.page b/tests/FunctionalTests/tickets/protected/pages/Issue120.page
new file mode 100644
index 00000000..0b504849
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Issue120.page
@@ -0,0 +1,13 @@
+<com:TContent ID="Content">
+ <h1>TActiveDropDownList PromptValue Test</h1>
+
+ <com:TActiveDropDownList id="ddl1" PromptValue="PromptValue" PromptText="PromptText">
+ <com:TListItem Value="value 1" Text="item 1" />
+ <com:TListItem Value="value 2" Text="item 2" />
+ <com:TListItem Value="value 3" Text="item 3" />
+ <com:TListItem Value="value 4" Text="item 4" />
+ </com:TActiveDropDownList>
+
+ <com:TActiveButton id="btn1" OnCallback="buttonClickCallback" />
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Issue120.php b/tests/FunctionalTests/tickets/protected/pages/Issue120.php
new file mode 100644
index 00000000..c04ae93d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Issue120.php
@@ -0,0 +1,22 @@
+<?php
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Issue120 extends TPage
+{
+ public function buttonClickCallback($sender, $param)
+ {
+
+ $this -> ddl1 -> setDataSource(
+ array(
+ 'callback value 1' => 'callback item 1',
+ 'callback value 2' => 'callback item 2',
+ 'callback value 3' => 'callback item 3',
+ 'callback value 4' => 'callback item 4'
+ )
+ );
+ $this -> ddl1 -> dataBind();
+
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.php b/tests/FunctionalTests/tickets/protected/pages/Layout.php
index 0e549fa7..6d455371 100644
--- a/tests/FunctionalTests/tickets/protected/pages/Layout.php
+++ b/tests/FunctionalTests/tickets/protected/pages/Layout.php
@@ -4,10 +4,19 @@ class Layout extends TTemplateControl
{
public function onLoad($param)
{
- $num = str_replace('Ticket','',$this->getPage()->getPagePath());
- $this->getPage()->setTitle("Verifying Ticket $num");
- $this->ticketlink->setText("Verifying Ticket $num");
- $this->ticketlink->setNavigateUrl("http://trac.pradosoft.com/prado/ticket/{$num}");
+ $num = str_replace(array('Ticket', 'Issue'), '', $this->getPage()->getPagePath());
+ $type = str_replace($num, '', $this->getPage()->getPagePath());
+
+ $this->getPage()->setTitle("Verifying $type $num");
+ $this->ticketlink->setText("Verifying $type $num");
+
+ if(strToLower($type) === 'issue') {
+ $this->ticketlink->setNavigateUrl("http://code.google.com/p/prado3/issues/detail?id={$num}");
+ }
+ else {
+ $this->ticketlink->setNavigateUrl("http://trac.pradosoft.com/prado/ticket/{$num}");
+ }
+
}
}
diff --git a/tests/FunctionalTests/tickets/tests/Issue120TestCase.php b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php
new file mode 100644
index 00000000..a2823c9d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php
@@ -0,0 +1,21 @@
+<?php
+
+class Issue120TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Issue120');
+ $this->assertTextPresent('TActiveDropDownList PromptValue Test');
+
+ $this->assertSelectedIndex("ctl0_Content_ddl1", 0);
+ $this->assertSelectedValue("ctl0_Content_ddl1", 'PromptValue');
+
+ $this->click("ctl0_Content_btn1");
+ $this->pause(800);
+
+ $this->assertSelectedIndex("ctl0_Content_ddl1", 0);
+ $this->assertSelectedValue("ctl0_Content_ddl1", 'PromptValue');
+ }
+}
+
+?> \ No newline at end of file