summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorwei <>2006-01-06 22:21:07 +0000
committerwei <>2006-01-06 22:21:07 +0000
commit333eedb6eea18fdfb7bc0890cce1c30e6d44d363 (patch)
tree5b34d4181cd55e0219003d67d22a8438ac21b0d2 /tests
parent16660934cc48f357b1322bce7869158db2f7cb58 (diff)
Diffstat (limited to 'tests')
-rw-r--r--tests/FunctionalTests/README.txt6
-rw-r--r--tests/FunctionalTests/index.php5
-rw-r--r--tests/FunctionalTests/protected/application.xml18
-rw-r--r--tests/FunctionalTests/protected/pages/I18N/BasicI18N.page3
-rw-r--r--tests/FunctionalTests/protected/pages/I18N/BasicI18N.php13
-rw-r--r--tests/FunctionalTests/protected/runtime/config.cachebin1543 -> 2357 bytes
-rw-r--r--tests/FunctionalTests/selenium/php/selenium.php5
7 files changed, 26 insertions, 24 deletions
diff --git a/tests/FunctionalTests/README.txt b/tests/FunctionalTests/README.txt
index 189f69ad..06519092 100644
--- a/tests/FunctionalTests/README.txt
+++ b/tests/FunctionalTests/README.txt
@@ -48,11 +48,11 @@ class testMyButtonExample extends SeleniumTestCase
{
function setup()
{
- //initializes $this->Page to be MyButtonExample instance
- $this->initPage(__FILE__);
+ //get the test page url
+ $page = Prado::getApplication()->getTestPage(__FILE__);
//open MyButtonExample page
- $this->open($this->Page->Request->TestUrl);
+ $this->open($page);
}
function testButtonClick()
diff --git a/tests/FunctionalTests/index.php b/tests/FunctionalTests/index.php
index 442c4bbf..da60b2f0 100644
--- a/tests/FunctionalTests/index.php
+++ b/tests/FunctionalTests/index.php
@@ -1,7 +1,7 @@
<?php
require('config.php');
-
+header("Content-Type: text/html; charset=UTF-8");
class BrowserTestConfig extends PradoTestConfig
{
//functional test groups
@@ -17,7 +17,8 @@ class BrowserTestConfig extends PradoTestConfig
$groups[] = realpath($base);
$dirs = new DirectoryIterator($base);
foreach($dirs as $dir)
- if(!$dir->isDot() && $dir->isDir())
+ if(!$dir->isDot() && $dir->isDir()
+ && !preg_match("/\.svn/", $dir->getPathName()))
$this->get_directories($dir->getPathName(), $groups);
}
}
diff --git a/tests/FunctionalTests/protected/application.xml b/tests/FunctionalTests/protected/application.xml
index c4ea0be2..fe17e3c0 100644
--- a/tests/FunctionalTests/protected/application.xml
+++ b/tests/FunctionalTests/protected/application.xml
@@ -7,18 +7,12 @@
</paths>
<modules>
- <module id="globalization" class="TGlobalization" Culture="zh_CN">
-
- <!-- The translation type and source -->
- <translation
- type="XLIFF"
- source="Tests.messages"
- autosave="true"
- cache="true"
- />
- <!-- <translation type="gettext" source="I18N/messages" autosave="true" /> -->
- <!-- <translation type="SQLite" source="sqlite:///I18N/messages/sqlite_messages.db" autosave="true" /> -->
- <!-- <translation type="MySQL" source="mysql://root@localhost/i18n_example" autosave="true" /> -->
+ <module id="globalization" class="TGlobalization">
+ <translation type="XLIFF" source="Tests.messages"
+ autosave="true" cache="true" />
+ </module>
+ <module id="logger" class="System.Log.TEventLog">
+ <logger destination="file" directory="Tests.logs" />
</module>
</modules>
</application> \ No newline at end of file
diff --git a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page
index 4e4a6d72..e09c2161 100644
--- a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page
+++ b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page
@@ -1,3 +1,4 @@
+<%@ Application.Globalization.Culture="zh_CN" %>
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -35,7 +36,7 @@
<div>
<com:TNumberFormat Value="10000" Type="currency"/>
</div>
-<div><com:TDateFormat /></div>
+<div><com:TDateFormat Value="2006-01-15"/></div>
<div>
<com:TChoiceFormat Value="0">
diff --git a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.php b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.php
index 50d493d8..6920f439 100644
--- a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.php
+++ b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.php
@@ -24,11 +24,22 @@ class BasicI18N extends TPage
*/
class BasicI18NTestCase extends SeleniumTestCase
{
- function testI18N()
+ 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/protected/runtime/config.cache b/tests/FunctionalTests/protected/runtime/config.cache
index 33317f88..890ff3da 100644
--- a/tests/FunctionalTests/protected/runtime/config.cache
+++ b/tests/FunctionalTests/protected/runtime/config.cache
Binary files differ
diff --git a/tests/FunctionalTests/selenium/php/selenium.php b/tests/FunctionalTests/selenium/php/selenium.php
index 33dc8801..5c24e57d 100644
--- a/tests/FunctionalTests/selenium/php/selenium.php
+++ b/tests/FunctionalTests/selenium/php/selenium.php
@@ -459,11 +459,6 @@ class SeleniumTestCase extends UnitTestCase
parent::__construct();
}
- public function initPage($file)
- {
- $this->Page = prado::getApplication()->getTestPage($file);
- }
-
function __call($func, $args)
{
if(count($args) == 0)