From 88ca6ce4fae584a72470343d9e786c8ac736c62d Mon Sep 17 00:00:00 2001
From: "godzilla80@gmx.net" <>
Date: Fri, 20 Mar 2009 06:51:50 +0000
Subject: Fixed Issue #120

---
 .../tickets/protected/pages/Issue120.page          | 13 +++++++++++++
 .../tickets/protected/pages/Issue120.php           | 22 ++++++++++++++++++++++
 .../tickets/tests/Issue120TestCase.php             | 21 +++++++++++++++++++++
 3 files changed, 56 insertions(+)
 create mode 100644 tests/FunctionalTests/tickets/protected/pages/Issue120.page
 create mode 100644 tests/FunctionalTests/tickets/protected/pages/Issue120.php
 create mode 100644 tests/FunctionalTests/tickets/tests/Issue120TestCase.php

(limited to 'tests/FunctionalTests')

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/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
-- 
cgit v1.2.3