summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/features
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/features')
-rw-r--r--tests/FunctionalTests/features/index.php8
-rw-r--r--tests/FunctionalTests/features/protected/application.xml9
-rw-r--r--tests/FunctionalTests/features/protected/controls/Layout.php8
-rw-r--r--tests/FunctionalTests/features/protected/controls/Layout.tpl27
-rw-r--r--tests/FunctionalTests/features/protected/pages/ColorPicker.page40
-rw-r--r--tests/FunctionalTests/features/protected/pages/DatePicker.page59
-rw-r--r--tests/FunctionalTests/features/protected/pages/FeatureList.page3
-rw-r--r--tests/FunctionalTests/features/protected/pages/FeatureList.php34
-rw-r--r--tests/FunctionalTests/features/protected/pages/HtmlArea.page10
-rw-r--r--tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.page31
-rw-r--r--tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php45
-rw-r--r--tests/FunctionalTests/features/protected/pages/I18N/Home.page3
-rw-r--r--tests/FunctionalTests/features/protected/pages/I18N/Home.zh_CN.page3
-rw-r--r--tests/FunctionalTests/features/protected/pages/I18N/config.xml12
-rw-r--r--tests/FunctionalTests/features/protected/pages/RatingList.page41
15 files changed, 333 insertions, 0 deletions
diff --git a/tests/FunctionalTests/features/index.php b/tests/FunctionalTests/features/index.php
new file mode 100644
index 00000000..fe127639
--- /dev/null
+++ b/tests/FunctionalTests/features/index.php
@@ -0,0 +1,8 @@
+<?php
+
+require_once(dirname(__FILE__).'/../../../framework/prado.php');
+
+$app=new TApplication;
+$app->run();
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/application.xml b/tests/FunctionalTests/features/protected/application.xml
new file mode 100644
index 00000000..642152cc
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/application.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<application id="FeatureTests" Mode="Debug">
+ <services>
+ <service id="page" class="TPageService" DefaultPage="FeatureList">
+ <pages MasterClass="Application.controls.Layout" />
+ </service>
+ </services>
+</application> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/controls/Layout.php b/tests/FunctionalTests/features/protected/controls/Layout.php
new file mode 100644
index 00000000..2c6e02d6
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/controls/Layout.php
@@ -0,0 +1,8 @@
+<?php
+
+class Layout extends TTemplateControl
+{
+
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/controls/Layout.tpl b/tests/FunctionalTests/features/protected/controls/Layout.tpl
new file mode 100644
index 00000000..18482377
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/controls/Layout.tpl
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<com:THead Title="PRADO Feature Tests">
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <style type="text/css">
+ /*<![CDATA[*/
+ body
+ {
+ font-family: Georgia, "Times New Roman", Times, serif;
+ }
+ .w3c
+ {
+ margin-top: 2em;
+ display: block;
+ }
+ /*]]>*/
+ </style>
+</com:THead>
+<body>
+<com:TForm>
+<com:TContentPlaceHolder ID="Content" />
+</com:TForm>
+</body>
+</html> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/ColorPicker.page b/tests/FunctionalTests/features/protected/pages/ColorPicker.page
new file mode 100644
index 00000000..3d8c46db
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/ColorPicker.page
@@ -0,0 +1,40 @@
+<com:TContent ID="Content">
+
+<com:TColorPicker Text="#FFCC00" /><br />
+
+
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+
+<p>asda<br /></p>
+<p>asda<br /></p>
+
+<com:TColorPicker Mode="Simple" /><br />
+
+
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+
+<com:TColorPicker ShowColorPicker="false" /><br />
+
+<p>asda<br /></p>
+
+<com:TColorPicker Mode="Full" /><br />
+
+<p>asda<br /></p>
+<p>asda<br /></p>
+
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+<p>asda<br /></p>
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/DatePicker.page b/tests/FunctionalTests/features/protected/pages/DatePicker.page
new file mode 100644
index 00000000..4347f748
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/DatePicker.page
@@ -0,0 +1,59 @@
+<com:TContent ID="Content">
+
+<h1>TDatePicker Samples</h1>
+
+<table class="sampletable">
+
+<tr>
+ <td class="samplenote">Default TDatePicker</td>
+ <td class="sampleaction">
+ <com:TDatePicker />
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">Button Mode</td>
+ <td class="sampleaction">
+ <com:TDatePicker Mode="Button" />
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">InputMode="DropDownList", custom DateFormat</td>
+ <td class="sampleaction">
+ <com:TDatePicker DateFormat="yyyy/MMMM" InputMode="DropDownList"/>
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">InputMode="DropDownList", custom DateFormat, Culture</td>
+ <td class="sampleaction">
+ <com:TDatePicker DateFormat="MM/yyyy" Culture="fr" InputMode="DropDownList"/>
+ </td>
+</tr>
+
+
+<tr>
+ <td class="samplenote">Custom DateFormat, culture, ImageButton mode</td>
+ <td class="sampleaction">
+ <com:TDatePicker Mode="ImageButton" Culture="zh_CN" DateFormat="日期:yyyy年M月d日"/>
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">Custom DateFormat, DropDownList, pre-selected date set in as Text</td>
+ <td class="sampleaction">
+ <com:TDatePicker DateFormat="yyyy/MMMM/dd" Text="2005/05/15" InputMode="DropDownList"/>
+ </td>
+</tr>
+
+<tr>
+ <td class="samplenote">DropDownList, pre-selected date as integer</td>
+ <td class="sampleaction">
+ <com:TDatePicker InputMode="DropDownList" Date=<%= @strtotime("-1 month") %>/>
+ </td>
+</tr>
+
+</table>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/FeatureList.page b/tests/FunctionalTests/features/protected/pages/FeatureList.page
new file mode 100644
index 00000000..ef25ccb9
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/FeatureList.page
@@ -0,0 +1,3 @@
+<com:TContent ID="Content">
+<com:TBulletedList ID="List" DisplayMode="HyperLink"/>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/FeatureList.php b/tests/FunctionalTests/features/protected/pages/FeatureList.php
new file mode 100644
index 00000000..7f82d34e
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/FeatureList.php
@@ -0,0 +1,34 @@
+<?php
+
+class FeatureList extends TPage
+{
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ $list=$this->getPageList(dirname(__FILE__),'');
+ $this->List->DataSource=$list;
+ $this->List->dataBind();
+ }
+
+ protected function getPageList($directory,$basePath)
+ {
+ $list=array();
+ $folder=@opendir($directory);
+ while($entry=@readdir($folder))
+ {
+ if($entry[0]==='.')
+ continue;
+ else if(is_file($directory.'/'.$entry))
+ {
+ if(($page=basename($entry,'.page'))!==$entry && strpos($page,'.')===false)
+ $list['?page='.$basePath.$page]=$basePath.$page;
+ }
+ else
+ $list=array_merge($list,$this->getPageList($directory.'/'.$entry,$basePath.$entry.'.'));
+ }
+ closedir($folder);
+ return $list;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/HtmlArea.page b/tests/FunctionalTests/features/protected/pages/HtmlArea.page
new file mode 100644
index 00000000..8b56f48d
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/HtmlArea.page
@@ -0,0 +1,10 @@
+<%@ Application.Globalization.Charset="GB2312" %>
+<com:TContent ID="Content">
+
+ <com:THtmlArea>
+ <prop:Options>
+ plugins : "contextmenu,paste",
+ language: "zh_CN"
+ </prop:Options>
+ </com:THtmlArea>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.page b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.page
new file mode 100644
index 00000000..e13eecf2
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.page
@@ -0,0 +1,31 @@
+<%@ Title="Basic I18N Test" Application.Globalization.Culture="zh_CN" %>
+<com:TContent ID="Content">
+<h1>Basic I18N Test</h1>
+<com:TTranslate>
+ Hello {name}
+ <com:TTranslateParameter Key="name">
+ <com:TLabel>
+ <com:TTranslate>Name</com:TTranslate>
+ </com:TLabel>
+ </com:TTranslateParameter>
+</com:TTranslate>
+
+<div>
+<com:TNumberFormat Value="10000" Type="currency"/>
+</div>
+<div><com:TDateFormat Value="2006-01-15" Culture="zh_CN"/></div>
+
+<div>
+<com:TChoiceFormat Value="0">
+ [0] None |[1] One thing. |[2,Inf) Many things.
+</com:TChoiceFormat><br />
+
+<com:TChoiceFormat Value="1">
+ [0] None |[1] One thing. |[2,Inf) Many things.
+</com:TChoiceFormat><br />
+
+<com:TChoiceFormat Value="5">
+ [0] None |[1] One thing. |[2,Inf) Many things.
+</com:TChoiceFormat>
+</div>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
new file mode 100644
index 00000000..cac0a04e
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * ${classname}
+ *
+ * ${description}
+ *
+ * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
+ * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
+ * @package ${package}
+ */
+class BasicI18N extends TPage
+{
+}
+
+/**
+ * ${classname}
+ *
+ * ${description}
+ *
+ * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
+ * @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
+ * @package ${package}
+ *//*
+class BasicI18NTestCase extends SeleniumTestCase
+{
+ function setup()
+ {
+ $page = Prado::getApplication()->getTestPage(__FILE__);
+ $this->open($page);
+ }
+
+ function testI18N()
+ {
+ $this->verifyTitle("Basic I18N Test", "");
+ $this->verifyTextPresent("Hello", "");
+ $this->verifyTextPresent("US$10,000.00", "");
+ $this->verifyTextPresent("2006年1月15日 上午12时00分00秒", "");
+ $this->verifyTextPresent("None", "");
+ $this->verifyTextPresent("One thing.", "");
+ $this->verifyTextPresent("Many things.", "");
+ }
+}
+*/
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/I18N/Home.page b/tests/FunctionalTests/features/protected/pages/I18N/Home.page
new file mode 100644
index 00000000..9a49e3a2
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/I18N/Home.page
@@ -0,0 +1,3 @@
+<com:TContent ID="Content">
+<h1>Prado Functional Tests</h1>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/I18N/Home.zh_CN.page b/tests/FunctionalTests/features/protected/pages/I18N/Home.zh_CN.page
new file mode 100644
index 00000000..1b931cc2
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/I18N/Home.zh_CN.page
@@ -0,0 +1,3 @@
+<com:TContent ID="Content">
+<h1>Prado Functional Tests (Chinese)</h1>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/I18N/config.xml b/tests/FunctionalTests/features/protected/pages/I18N/config.xml
new file mode 100644
index 00000000..25e26ac5
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/I18N/config.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+ <paths>
+ <using namespace="System.I18N.*" />
+ </paths>
+ <modules>
+ <module id="globalization" class="TGlobalization">
+ <translation type="XLIFF" source="Application.pages.I18N.messages" autosave="true" cache="true" />
+ </module>
+ </modules>
+</configuration> \ No newline at end of file
diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.page b/tests/FunctionalTests/features/protected/pages/RatingList.page
new file mode 100644
index 00000000..909180c7
--- /dev/null
+++ b/tests/FunctionalTests/features/protected/pages/RatingList.page
@@ -0,0 +1,41 @@
+<com:TContent ID="Content">
+<h1>TRatingList Examples</h1>
+
+<h2>Default TRatingList</h2>
+ <com:TRatingList RepeatDirection="Vertical" Style="caption-side: right;">
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Execellent" />
+ </com:TRatingList>
+
+<h2>TRatingList </h2>
+ <com:TRatingList SelectedIndex="2">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Super" />
+ </com:TRatingList>
+
+<h2>TRatingList </h2>
+ <com:TRatingList RatingStyle="blocks" SelectedValue="Good">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Super" />
+ </com:TRatingList>
+
+<h2>TRatingList </h2>
+ <com:TRatingList ID="Rating1" AllowInput="false" Caption="Rating:" Rating="4.6">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Execellent" />
+ <com:TListItem Text="Super" />
+ </com:TRatingList>
+</com:TContent> \ No newline at end of file