From 9db90898be134c9f70c0b334ec071223e60ed76c Mon Sep 17 00:00:00 2001
From: xue <>
Date: Sun, 16 Apr 2006 18:02:31 +0000
Subject: Merge from 3.0 branch till 924
---
.gitattributes | 23 +++--
framework/I18N/TI18NControl.php | 2 +-
framework/I18N/TNumberFormat.php | 2 +-
framework/I18N/TTranslate.php | 2 +-
framework/PradoBase.php | 4 +-
framework/TApplication.php | 5 +-
framework/Util/TPropelLogRoute.php | 98 ---------------------
framework/Web/THttpResponse.php | 10 +--
framework/Web/UI/TTemplateManager.php | 2 +-
framework/Web/UI/WebControls/TDatePicker.php | 2 +-
index.html | 22 ++---
.../features/protected/pages/ImageMap/Home.page | 43 ---------
.../features/protected/pages/ImageMap/Home.php | 12 ---
.../features/protected/pages/ImageMap/hotspot.jpg | Bin 12206 -> 0 bytes
.../features/protected/pages/MultiView/Home.page | 24 -----
.../features/protected/pages/Wizard/Home.page | 35 --------
tests/FunctionalTests/index.php | 1 +
tests/FunctionalTests/validators.php | 8 ++
tests/FunctionalTests/validators/index.php | 8 ++
.../validators/protected/pages/Button.page | 37 ++++++++
.../validators/protected/pages/Button.php | 27 ++++++
.../validators/protected/pages/CheckBox.page | 40 +++++++++
.../validators/protected/pages/CheckBox.php | 27 ++++++
.../validators/protected/pages/ImageButton.page | 37 ++++++++
.../validators/protected/pages/ImageButton.php | 27 ++++++
.../validators/protected/pages/Layout.php | 7 ++
.../validators/protected/pages/Layout.tpl | 34 +++++++
.../validators/protected/pages/LinkButton.page | 37 ++++++++
.../validators/protected/pages/LinkButton.php | 27 ++++++
.../validators/protected/pages/config.xml | 5 ++
.../validators/tests/ButtonTestCase.php | 65 ++++++++++++++
.../validators/tests/CheckBoxTestCase.php | 67 ++++++++++++++
.../validators/tests/ImageButtonTestCase.php | 65 ++++++++++++++
.../validators/tests/LinkButtonTestCase.php | 64 ++++++++++++++
34 files changed, 628 insertions(+), 241 deletions(-)
delete mode 100644 framework/Util/TPropelLogRoute.php
delete mode 100644 tests/FunctionalTests/features/protected/pages/ImageMap/Home.page
delete mode 100644 tests/FunctionalTests/features/protected/pages/ImageMap/Home.php
delete mode 100644 tests/FunctionalTests/features/protected/pages/ImageMap/hotspot.jpg
delete mode 100644 tests/FunctionalTests/features/protected/pages/MultiView/Home.page
delete mode 100644 tests/FunctionalTests/features/protected/pages/Wizard/Home.page
create mode 100644 tests/FunctionalTests/validators.php
create mode 100644 tests/FunctionalTests/validators/index.php
create mode 100644 tests/FunctionalTests/validators/protected/pages/Button.page
create mode 100644 tests/FunctionalTests/validators/protected/pages/Button.php
create mode 100644 tests/FunctionalTests/validators/protected/pages/CheckBox.page
create mode 100644 tests/FunctionalTests/validators/protected/pages/CheckBox.php
create mode 100644 tests/FunctionalTests/validators/protected/pages/ImageButton.page
create mode 100644 tests/FunctionalTests/validators/protected/pages/ImageButton.php
create mode 100644 tests/FunctionalTests/validators/protected/pages/Layout.php
create mode 100644 tests/FunctionalTests/validators/protected/pages/Layout.tpl
create mode 100644 tests/FunctionalTests/validators/protected/pages/LinkButton.page
create mode 100644 tests/FunctionalTests/validators/protected/pages/LinkButton.php
create mode 100644 tests/FunctionalTests/validators/protected/pages/config.xml
create mode 100644 tests/FunctionalTests/validators/tests/ButtonTestCase.php
create mode 100644 tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
create mode 100644 tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
create mode 100644 tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
diff --git a/.gitattributes b/.gitattributes
index d131ec36..d49db2bb 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -839,7 +839,6 @@ framework/Util/TDataFieldAccessor.php -text
framework/Util/TLogRouter.php -text
framework/Util/TLogger.php -text
framework/Util/TParameterModule.php -text
-framework/Util/TPropelLogRoute.php -text
framework/Util/TSimpleDateFormatter.php -text
framework/Util/TVarDumper.php -text
framework/Web/Javascripts/TJSON.php -text
@@ -1036,12 +1035,7 @@ tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php -text
tests/FunctionalTests/features/protected/pages/I18N/Home.page -text
tests/FunctionalTests/features/protected/pages/I18N/Home.zh_CN.page -text
tests/FunctionalTests/features/protected/pages/I18N/config.xml -text
-tests/FunctionalTests/features/protected/pages/ImageMap/Home.page -text
-tests/FunctionalTests/features/protected/pages/ImageMap/Home.php -text
-tests/FunctionalTests/features/protected/pages/ImageMap/hotspot.jpg -text
-tests/FunctionalTests/features/protected/pages/MultiView/Home.page -text
tests/FunctionalTests/features/protected/pages/RatingList.page -text
-tests/FunctionalTests/features/protected/pages/Wizard/Home.page -text
tests/FunctionalTests/index.php -text
tests/FunctionalTests/quickstart.php -text
tests/FunctionalTests/quickstart/Advanced/I18N.php -text
@@ -1160,6 +1154,23 @@ tests/FunctionalTests/tickets/tests/Ticket21TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket27TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket54TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket72TestCase.php -text
+tests/FunctionalTests/validators.php -text
+tests/FunctionalTests/validators/index.php -text
+tests/FunctionalTests/validators/protected/pages/Button.page -text
+tests/FunctionalTests/validators/protected/pages/Button.php -text
+tests/FunctionalTests/validators/protected/pages/CheckBox.page -text
+tests/FunctionalTests/validators/protected/pages/CheckBox.php -text
+tests/FunctionalTests/validators/protected/pages/ImageButton.page -text
+tests/FunctionalTests/validators/protected/pages/ImageButton.php -text
+tests/FunctionalTests/validators/protected/pages/Layout.php -text
+tests/FunctionalTests/validators/protected/pages/Layout.tpl -text
+tests/FunctionalTests/validators/protected/pages/LinkButton.page -text
+tests/FunctionalTests/validators/protected/pages/LinkButton.php -text
+tests/FunctionalTests/validators/protected/pages/config.xml -text
+tests/FunctionalTests/validators/tests/ButtonTestCase.php -text
+tests/FunctionalTests/validators/tests/CheckBoxTestCase.php -text
+tests/FunctionalTests/validators/tests/ImageButtonTestCase.php -text
+tests/FunctionalTests/validators/tests/LinkButtonTestCase.php -text
tests/UnitTests/TODO.txt -text
tests/UnitTests/framework/Collections/utList.php -text
tests/UnitTests/framework/Collections/utMap.php -text
diff --git a/framework/I18N/TI18NControl.php b/framework/I18N/TI18NControl.php
index e6aed0fa..efe3ac84 100644
--- a/framework/I18N/TI18NControl.php
+++ b/framework/I18N/TI18NControl.php
@@ -42,7 +42,7 @@ class TI18NControl extends TControl
*/
public function getCharset()
{
- $app = $this->getApplication()->getGlobalization();
+ $app = $this->getApplication()->getGlobalization(false);
//instance charset
$charset = $this->getViewState('Charset','');
diff --git a/framework/I18N/TNumberFormat.php b/framework/I18N/TNumberFormat.php
index 4dc1e3ee..76373a8e 100644
--- a/framework/I18N/TNumberFormat.php
+++ b/framework/I18N/TNumberFormat.php
@@ -166,7 +166,7 @@ class TNumberFormat extends TI18NControl
*/
protected function getFormattedValue()
{
- $app = $this->Application->getGlobalization();
+ $app = $this->getApplication()->getGlobalization();
//initialized the default class wide formatter
if(is_null(self::$formatter))
self::$formatter = new NumberFormat($app->getCulture());
diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php
index 0a03b506..6a30f3a6 100644
--- a/framework/I18N/TTranslate.php
+++ b/framework/I18N/TTranslate.php
@@ -168,7 +168,7 @@ class TTranslate extends TI18NControl
*/
protected function translateText($text, $subs)
{
- $app = $this->Application->getGlobalization();
+ $app = $this->getApplication()->getGlobalization();
//no translation handler provided
if(is_null($config = $app->getTranslationConfiguration()))
diff --git a/framework/PradoBase.php b/framework/PradoBase.php
index 08e503b1..7e631cb8 100644
--- a/framework/PradoBase.php
+++ b/framework/PradoBase.php
@@ -533,14 +533,14 @@ class PradoBase
public static function localize($text, $parameters=array(), $catalogue=null, $charset=null)
{
Prado::using('System.I18N.Translation');
- $app = Prado::getApplication()->getGlobalization();
+ $app = Prado::getApplication()->getGlobalization(false);
$params = array();
foreach($parameters as $key => $value)
$params['{'.$key.'}'] = $value;
//no translation handler provided
- if(($config = $app->getTranslationConfiguration())===null)
+ if($app===null || ($config = $app->getTranslationConfiguration())===null)
return strtr($text, $params);
Translation::init();
diff --git a/framework/TApplication.php b/framework/TApplication.php
index 893856de..ef2fd1a1 100644
--- a/framework/TApplication.php
+++ b/framework/TApplication.php
@@ -755,10 +755,13 @@ class TApplication extends TComponent
}
/**
+ * @param boolean whether to create globalization if it does not exist
* @return TGlobalization globalization module
*/
- public function getGlobalization()
+ public function getGlobalization($createIfNotExists=true)
{
+ if($this->_globalization===null && $createIfNotExists)
+ $this->_globalization=new TGlobalization;
return $this->_globalization;
}
diff --git a/framework/Util/TPropelLogRoute.php b/framework/Util/TPropelLogRoute.php
deleted file mode 100644
index eb87ca19..00000000
--- a/framework/Util/TPropelLogRoute.php
+++ /dev/null
@@ -1,98 +0,0 @@
-
- * @link http://www.pradosoft.com/
- * @copyright Copyright © 2006 PradoSoft
- * @license http://www.pradosoft.com/license/
- * @version $Revision: $ $Date: $
- * @package System.Util
- */
-
-/**
- * TPropelLogRoute class.
- *
- * TPropelLogRoute saves selected log messages into a Propel database.
- * The name of the Propel database object used to represent each message
- * is specified by {@link setPropelObjectName PropelObjectName}, which defaults
- * to 'PradoLog'.
- *
- * The schema of the Propel object must be as follows (the table name can be
- * changed to the value of {@link getPropelObjectName PropelObjectName}.
- *
- *
- *
- *
- * @author Jason Ragsdale
- * @version $Revision: $ $Date: $
- * @package System.Util
- * @since 3.0
- */
-class TPropelLogRoute extends TLogRoute
-{
- private $_className='Pradolog';
-
- /**
- * @return string the name of the Prople object used to save each log message. Defaults to 'PradoLog'.
- */
- public function getPropelObjectName()
- {
- return $this->_className;
- }
-
- /**
- * @param string the name of the Prople object used to save each log message. The name can be in namespace format.
- */
- public function setPropelObjectName($value)
- {
- $this->_className=$value;
- }
-
- /**
- * Saves log messages to the Propel database object.
- *
- * @param array $logs
- */
- protected function processLogs($logs)
- {
- foreach($logs as $log)
- {
- $pradoLog=Prado::createComponent($this->_className);
- $pradoLog->setMessage($log[0]);
- $pradoLog->setLevel($this->getLevelName($log[1]));
- $pradoLog->setCategory($log[2]);
- $pradoLog->setTime($log[3]);
- $pradoLog->save();
- }
- }
-}
-?>
\ No newline at end of file
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index d4a62cc6..f76218ca 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -69,7 +69,7 @@ class THttpResponse extends TModule implements ITextWriter
/**
* @var string character set, e.g. UTF-8
*/
- private $_charset;
+ private $_charset='';
/**
* Destructor.
@@ -285,10 +285,10 @@ class THttpResponse extends TModule implements ITextWriter
*/
protected function sendContentTypeHeader()
{
- $charset = $this->getCharset();
- if(empty($charset) && ($globalization=$this->getApplication()->getGlobalization())!==null)
- $charset = $globalization->getCharset();
- if(!empty($charset))
+ $charset=$this->getCharset();
+ if($charset==='' && ($globalization=$this->getApplication()->getGlobalization(false))!==null)
+ $charset=$globalization->getCharset();
+ if($charset==='')
{
$header='Content-Type: '.$this->getContentType().';charset='.$charset;
$this->appendHeader($header);
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index 488a3a3b..6b7202f7 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -105,7 +105,7 @@ class TTemplateManager extends TModule
*/
protected function getLocalizedTemplate($filename)
{
- if(($app=$this->getApplication()->getGlobalization())===null)
+ if(($app=$this->getApplication()->getGlobalization(false))===null)
return $filename;
foreach($app->getLocalizedResource($filename) as $file)
{
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 9bb352d6..c6a2345b 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -406,7 +406,7 @@ class TDatePicker extends TTextBox
*/
protected function getCurrentCulture()
{
- $app = $this->getApplication()->getGlobalization();
+ $app = $this->getApplication()->getGlobalization(false);
return $this->getCulture() == '' ?
($app ? $app->getCulture() : 'en') : $this->getCulture();
}
diff --git a/index.html b/index.html
index d79840d2..c2c3d5e7 100644
--- a/index.html
+++ b/index.html
@@ -36,21 +36,23 @@ PRADO has been tested with Apache 2.0 on both Windows XP and RedHat Linux.
Installation
+
+After downloading the latest PRADO release file, unpack it to a Web-accessible directory.
+The installation is done! You will see the following subdirectories,
+
- - Unpack the distribution file using "unzip" command on Linux or
- "winzip" program on Windows.
- - Copy all the files and directories under the unpacked "prado"
- directory to the DocumentRoot of the Web server (or a subdirectory of that).
- - Browse the URL, http://<Web-server-address>/requirements/index.php, to see
- if your Web server configuration satisfies the requirement for using PRADO.
- - The directory "framework" contains the core code of PRADO.
- - The directory "docs/manual" contains the PRADO API documentation
- in HTML format.
+ - framework - contains the core code of PRADO. This directory does NOT need
+ to reside in a Web directory.
+ - demos - contains several demo applications.
+ - docs - contains tutorials and documentation.
+ - requirements - contains a requirement checker script that can check if your
+ system can run PRADO applications.
+
Included Demos
diff --git a/tests/FunctionalTests/features/protected/pages/ImageMap/Home.page b/tests/FunctionalTests/features/protected/pages/ImageMap/Home.page
deleted file mode 100644
index 34631125..00000000
--- a/tests/FunctionalTests/features/protected/pages/ImageMap/Home.page
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
- AlternateText="Navigate buttons" OnClick="buttonClicked" >
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ImageMap/Home.php b/tests/FunctionalTests/features/protected/pages/ImageMap/Home.php
deleted file mode 100644
index 36ec7e9c..00000000
--- a/tests/FunctionalTests/features/protected/pages/ImageMap/Home.php
+++ /dev/null
@@ -1,12 +0,0 @@
-getPostBackValue();
- print_r($param);
- }
-}
-
-?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ImageMap/hotspot.jpg b/tests/FunctionalTests/features/protected/pages/ImageMap/hotspot.jpg
deleted file mode 100644
index 3491813f..00000000
Binary files a/tests/FunctionalTests/features/protected/pages/ImageMap/hotspot.jpg and /dev/null differ
diff --git a/tests/FunctionalTests/features/protected/pages/MultiView/Home.page b/tests/FunctionalTests/features/protected/pages/MultiView/Home.page
deleted file mode 100644
index 30ee1bbe..00000000
--- a/tests/FunctionalTests/features/protected/pages/MultiView/Home.page
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
- view 1
-
-
-
-
-
- view 2
-
-
-
-
-
- view 3
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/Wizard/Home.page b/tests/FunctionalTests/features/protected/pages/Wizard/Home.page
deleted file mode 100644
index bcd93fef..00000000
--- a/tests/FunctionalTests/features/protected/pages/Wizard/Home.page
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
- step 1
-
-
-
-
- step 2
-
-
-
-
-
-
-
-
-
-
-
-
- step 3
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/FunctionalTests/index.php b/tests/FunctionalTests/index.php
index 2cfcfd1f..c22543c0 100644
--- a/tests/FunctionalTests/index.php
+++ b/tests/FunctionalTests/index.php
@@ -8,6 +8,7 @@ Prado Functional Test Suites
Prado Functional Test Suites
diff --git a/tests/FunctionalTests/validators.php b/tests/FunctionalTests/validators.php
new file mode 100644
index 00000000..c86604c8
--- /dev/null
+++ b/tests/FunctionalTests/validators.php
@@ -0,0 +1,8 @@
+run(new SimpleReporter());
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/index.php b/tests/FunctionalTests/validators/index.php
new file mode 100644
index 00000000..fe127639
--- /dev/null
+++ b/tests/FunctionalTests/validators/index.php
@@ -0,0 +1,8 @@
+run();
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/Button.page b/tests/FunctionalTests/validators/protected/pages/Button.page
new file mode 100644
index 00000000..5acc596b
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Button.page
@@ -0,0 +1,37 @@
+
+Validations Triggered by TButton
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/Button.php b/tests/FunctionalTests/validators/protected/pages/Button.php
new file mode 100644
index 00000000..3dbbc7d6
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Button.php
@@ -0,0 +1,27 @@
+Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/CheckBox.page b/tests/FunctionalTests/validators/protected/pages/CheckBox.page
new file mode 100644
index 00000000..e5cb39ff
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CheckBox.page
@@ -0,0 +1,40 @@
+
+Validations Triggered by TCheckBox
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/CheckBox.php b/tests/FunctionalTests/validators/protected/pages/CheckBox.php
new file mode 100644
index 00000000..700ac171
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CheckBox.php
@@ -0,0 +1,27 @@
+Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/ImageButton.page b/tests/FunctionalTests/validators/protected/pages/ImageButton.page
new file mode 100644
index 00000000..d1fae361
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/ImageButton.page
@@ -0,0 +1,37 @@
+
+Validations Triggered by TImageButton
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/ImageButton.php b/tests/FunctionalTests/validators/protected/pages/ImageButton.php
new file mode 100644
index 00000000..ecedd5bf
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/ImageButton.php
@@ -0,0 +1,27 @@
+Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/Layout.php b/tests/FunctionalTests/validators/protected/pages/Layout.php
new file mode 100644
index 00000000..ba96038b
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Layout.php
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/Layout.tpl b/tests/FunctionalTests/validators/protected/pages/Layout.tpl
new file mode 100644
index 00000000..224481e1
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Layout.tpl
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/LinkButton.page b/tests/FunctionalTests/validators/protected/pages/LinkButton.page
new file mode 100644
index 00000000..8ed1c338
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/LinkButton.page
@@ -0,0 +1,37 @@
+
+Validations Triggered by TLinkButton
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/LinkButton.php b/tests/FunctionalTests/validators/protected/pages/LinkButton.php
new file mode 100644
index 00000000..5130dd01
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/LinkButton.php
@@ -0,0 +1,27 @@
+Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/config.xml b/tests/FunctionalTests/validators/protected/pages/config.xml
new file mode 100644
index 00000000..83bb5791
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/config.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/ButtonTestCase.php b/tests/FunctionalTests/validators/tests/ButtonTestCase.php
new file mode 100644
index 00000000..46e037dc
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/ButtonTestCase.php
@@ -0,0 +1,65 @@
+open('validators/index.php?page=Button');
+
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
new file mode 100644
index 00000000..6783572d
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
@@ -0,0 +1,67 @@
+open('validators/index.php?page=CheckBox');
+
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
new file mode 100644
index 00000000..1a4d88c1
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
@@ -0,0 +1,65 @@
+open('validators/index.php?page=ImageButton');
+
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
new file mode 100644
index 00000000..47122442
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
@@ -0,0 +1,64 @@
+open('validators/index.php?page=LinkButton');
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?>
\ No newline at end of file
--
cgit v1.2.3