From 269c9a0010c2495db961c185e83fd52b33b04d73 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Tue, 11 Sep 2007 02:09:27 +0000
Subject: Fixed #692, #700.
---
tests/FunctionalTests/tickets/index700.php | 8 +++
.../tickets/protected700/application.xml | 32 ++++++++++
.../tickets/protected700/common/BasePage.php | 68 ++++++++++++++++++++
.../tickets/protected700/layout/MainLayout.php | 12 ++++
.../tickets/protected700/layout/MainLayout.tpl | 26 ++++++++
.../tickets/protected700/pages/Home.page | 14 +++++
.../tickets/protected700/pages/UserLogin.page | 28 +++++++++
.../tickets/protected700/pages/UserLogin.php | 13 ++++
.../tickets/protected700/pages/admin/Home.page | 14 +++++
.../tickets/protected700/pages/admin/Home2.page | 14 +++++
.../tickets/protected700/pages/admin/config.xml | 11 ++++
.../protected700/pages/admin/users/Home.page | 14 +++++
.../protected700/pages/admin/users/Home2.page | 14 +++++
.../protected700/pages/admin/users/config.xml | 6 ++
.../tickets/protected700/pages/config.xml | 10 +++
.../tickets/protected700/pages/content/Home.page | 14 +++++
.../tickets/tests/Ticket700TestCase.php | 72 ++++++++++++++++++++++
17 files changed, 370 insertions(+)
create mode 100644 tests/FunctionalTests/tickets/index700.php
create mode 100644 tests/FunctionalTests/tickets/protected700/application.xml
create mode 100644 tests/FunctionalTests/tickets/protected700/common/BasePage.php
create mode 100644 tests/FunctionalTests/tickets/protected700/layout/MainLayout.php
create mode 100644 tests/FunctionalTests/tickets/protected700/layout/MainLayout.tpl
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/Home.page
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/UserLogin.page
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/UserLogin.php
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/admin/Home.page
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/admin/Home2.page
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/admin/config.xml
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/admin/users/Home.page
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/admin/users/Home2.page
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/admin/users/config.xml
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/config.xml
create mode 100644 tests/FunctionalTests/tickets/protected700/pages/content/Home.page
create mode 100644 tests/FunctionalTests/tickets/tests/Ticket700TestCase.php
(limited to 'tests')
diff --git a/tests/FunctionalTests/tickets/index700.php b/tests/FunctionalTests/tickets/index700.php
new file mode 100644
index 00000000..d35f789f
--- /dev/null
+++ b/tests/FunctionalTests/tickets/index700.php
@@ -0,0 +1,8 @@
+run();
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/application.xml b/tests/FunctionalTests/tickets/protected700/application.xml
new file mode 100644
index 00000000..cb00aae3
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/application.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/FunctionalTests/tickets/protected700/common/BasePage.php b/tests/FunctionalTests/tickets/protected700/common/BasePage.php
new file mode 100644
index 00000000..1e40f754
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/common/BasePage.php
@@ -0,0 +1,68 @@
+Title=$this->PagePath;
+ }
+
+ public function getParam1()
+ {
+ return $this->_param1;
+ }
+
+ public function setParam1($value)
+ {
+ $this->_param1=$value;
+ }
+
+ public function getParam2()
+ {
+ return $this->_param2;
+ }
+
+ public function setParam2($value)
+ {
+ $this->_param2=$value;
+ }
+
+ public function getParam3()
+ {
+ return $this->_param3;
+ }
+
+ public function setParam3($value)
+ {
+ $this->_param3=$value;
+ }
+
+ public function getParam4()
+ {
+ return $this->_param4;
+ }
+
+ public function setParam4($value)
+ {
+ $this->_param4=$value;
+ }
+
+ public function getParam5()
+ {
+ return $this->_param5;
+ }
+
+ public function setParam5($value)
+ {
+ $this->_param5=$value;
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/layout/MainLayout.php b/tests/FunctionalTests/tickets/protected700/layout/MainLayout.php
new file mode 100644
index 00000000..3e0a3d19
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/layout/MainLayout.php
@@ -0,0 +1,12 @@
+Application->getModule('auth')->logout();
+ $this->Response->reload();
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/layout/MainLayout.tpl b/tests/FunctionalTests/tickets/protected700/layout/MainLayout.tpl
new file mode 100644
index 00000000..acbfa0e6
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/layout/MainLayout.tpl
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+<%= $this->Page->Title %>
+
+
+
+
+
+
+Login |
+ (<%= $this->User->Name %>)
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/Home.page b/tests/FunctionalTests/tickets/protected700/pages/Home.page
new file mode 100644
index 00000000..7d1c1187
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/Home.page
@@ -0,0 +1,14 @@
+
+
+|Param1: <%= $this->Param1 %>|
+
+|Param2: <%= $this->Param2 %>|
+
+|Param3: <%= $this->Param3 %>|
+
+|Param4: <%= $this->Param4 %>|
+
+|Param5: <%= $this->Param5 %>|
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/UserLogin.page b/tests/FunctionalTests/tickets/protected700/pages/UserLogin.page
new file mode 100644
index 00000000..07d4ece9
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/UserLogin.page
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/UserLogin.php b/tests/FunctionalTests/tickets/protected700/pages/UserLogin.php
new file mode 100644
index 00000000..37258879
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/UserLogin.php
@@ -0,0 +1,13 @@
+Application->getModule('auth');
+ $authManager->login($this->Username->Text,$this->Password->Text);
+ $this->Response->redirect($this->Service->constructUrl('Home'));
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/admin/Home.page b/tests/FunctionalTests/tickets/protected700/pages/admin/Home.page
new file mode 100644
index 00000000..7d1c1187
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/admin/Home.page
@@ -0,0 +1,14 @@
+
+
+|Param1: <%= $this->Param1 %>|
+
+|Param2: <%= $this->Param2 %>|
+
+|Param3: <%= $this->Param3 %>|
+
+|Param4: <%= $this->Param4 %>|
+
+|Param5: <%= $this->Param5 %>|
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/admin/Home2.page b/tests/FunctionalTests/tickets/protected700/pages/admin/Home2.page
new file mode 100644
index 00000000..7d1c1187
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/admin/Home2.page
@@ -0,0 +1,14 @@
+
+
+|Param1: <%= $this->Param1 %>|
+
+|Param2: <%= $this->Param2 %>|
+
+|Param3: <%= $this->Param3 %>|
+
+|Param4: <%= $this->Param4 %>|
+
+|Param5: <%= $this->Param5 %>|
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/admin/config.xml b/tests/FunctionalTests/tickets/protected700/pages/admin/config.xml
new file mode 100644
index 00000000..04ac6bdd
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/admin/config.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/admin/users/Home.page b/tests/FunctionalTests/tickets/protected700/pages/admin/users/Home.page
new file mode 100644
index 00000000..7d1c1187
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/admin/users/Home.page
@@ -0,0 +1,14 @@
+
+
+|Param1: <%= $this->Param1 %>|
+
+|Param2: <%= $this->Param2 %>|
+
+|Param3: <%= $this->Param3 %>|
+
+|Param4: <%= $this->Param4 %>|
+
+|Param5: <%= $this->Param5 %>|
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/admin/users/Home2.page b/tests/FunctionalTests/tickets/protected700/pages/admin/users/Home2.page
new file mode 100644
index 00000000..7d1c1187
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/admin/users/Home2.page
@@ -0,0 +1,14 @@
+
+
+|Param1: <%= $this->Param1 %>|
+
+|Param2: <%= $this->Param2 %>|
+
+|Param3: <%= $this->Param3 %>|
+
+|Param4: <%= $this->Param4 %>|
+
+|Param5: <%= $this->Param5 %>|
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/admin/users/config.xml b/tests/FunctionalTests/tickets/protected700/pages/admin/users/config.xml
new file mode 100644
index 00000000..175ea5c7
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/admin/users/config.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/config.xml b/tests/FunctionalTests/tickets/protected700/pages/config.xml
new file mode 100644
index 00000000..416de43f
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/config.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected700/pages/content/Home.page b/tests/FunctionalTests/tickets/protected700/pages/content/Home.page
new file mode 100644
index 00000000..7d1c1187
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected700/pages/content/Home.page
@@ -0,0 +1,14 @@
+
+
+|Param1: <%= $this->Param1 %>|
+
+|Param2: <%= $this->Param2 %>|
+
+|Param3: <%= $this->Param3 %>|
+
+|Param4: <%= $this->Param4 %>|
+
+|Param5: <%= $this->Param5 %>|
+
+
+
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php
new file mode 100644
index 00000000..e7ff30b3
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php
@@ -0,0 +1,72 @@
+open('tickets/index700.php');
+ $this->clickAndWait('ctl0_Logout');
+ $this->clickAndWait('pageHome');
+ $this->assertTitle("Home");
+ $this->assertTextPresent('|Param1: Set at app config|');
+ $this->assertTextPresent('|Param2: Set at root|');
+ $this->assertTextPresent('|Param3: default 3|');
+ $this->assertTextPresent('|Param4: default 4|');
+ $this->assertTextPresent('|Param5: Set at root|');
+
+ // page: admin.Home
+ $this->clickAndWait('pageAdminHome');
+ $this->assertTitle('UserLogin');
+ $this->type('ctl0_Main_Username','AdminUser');
+ $this->type('ctl0_Main_Password','demo');
+ $this->clickAndWait('ctl0_Main_LoginButton');
+ $this->clickAndWait('pageAdminHome');
+ $this->assertTitle('admin.Home');
+ $this->assertTextPresent('|Param1: Set at app config|');
+ $this->assertTextPresent('|Param2: Set at admin|');
+ $this->assertTextPresent('|Param3: Set at admin|');
+ $this->assertTextPresent('|Param4: Set at app config|');
+ $this->assertTextPresent('|Param5: Set at app config|');
+
+ // page: admin.Home2
+ $this->clickAndWait('pageAdminHome2');
+ $this->assertTitle('admin.Home2');
+ $this->clickAndWait('ctl0_Logout');
+ $this->clickAndWait('pageAdminHome2');
+ $this->assertTitle('admin.Home2');
+
+ // page: admin.users.Home
+ $this->clickAndWait('pageAdminUsersHome');
+ $this->assertTitle('UserLogin');
+ $this->type('ctl0_Main_Username','NormalUser');
+ $this->type('ctl0_Main_Password','demo');
+ $this->clickAndWait('ctl0_Main_LoginButton');
+ $this->clickAndWait('pageAdminUsersHome');
+ $this->assertTitle('UserLogin');
+ $this->type('ctl0_Main_Username','AdminUser');
+ $this->type('ctl0_Main_Password','demo');
+ $this->clickAndWait('ctl0_Main_LoginButton');
+ $this->clickAndWait('pageAdminUsersHome');
+ $this->assertTitle('admin.users.Home');
+ $this->assertTextPresent('|Param1: Set at admin|');
+ $this->assertTextPresent('|Param2: Set at admin.users|');
+ $this->assertTextPresent('|Param3: default 3|');
+ $this->assertTextPresent('|Param4: Set at admin|');
+ $this->assertTextPresent('|Param5: Set at app config|');
+
+ // page: admin.users.Home2
+ $this->clickAndWait('pageAdminUsersHome2');
+ $this->assertTitle('admin.users.Home2');
+
+ // page: content.Home
+ $this->clickAndWait('pageContentHome');
+ $this->assertTitle('content.Home');
+ $this->assertTextPresent('|Param1: Set at app config|');
+ $this->assertTextPresent('|Param2: Set at root|');
+ $this->assertTextPresent('|Param3: default 3|');
+ $this->assertTextPresent('|Param4: default 4|');
+ $this->assertTextPresent('|Param5: Set at app config|');
+ $this->clickAndWait('ctl0_Logout');
+ }
+}
+?>
\ No newline at end of file
--
cgit v1.2.3