This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via e38332209fb0516ed4b399386641e66f7c848cfd (commit)
from 4ac579b1f96ddeb51d8925ffaef275d260918cf5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e38332209fb0516ed4b399386641e66f7c848cfd
Author: Ivan1986 <iva...@li...>
Date: Wed Aug 25 18:39:23 2010 +0400
add test app
diff --git a/QFW/config.php b/QFW/config.php
index a6aa01a..4cf48f2 100644
--- a/QFW/config.php
+++ b/QFW/config.php
@@ -76,11 +76,11 @@ $config['cache'] = array(
'namespace' => '',
'tags' => false,
),
- 'MCA' => array(
+ /*'MCA' => array(
'module' => 'Xcache',
'namespace' => '',
'tags' => false,
- ),
+ ),*/
);
$config['templater'] = array(
diff --git a/tests/app/010_http_host.phpt b/tests/app/010_http_host.phpt
new file mode 100644
index 0000000..372ea73
--- /dev/null
+++ b/tests/app/010_http_host.phpt
@@ -0,0 +1,19 @@
+--TEST--
+QFW: test _SERVER HTTP_HOST
+--FILE--
+<?php
+
+define ('DOC_ROOT', dirname(__FILE__));
+define ('ROOTPATH', dirname(dirname(dirname(__FILE__))));
+define ('APPPATH', ROOTPATH . '/application');
+define ('TMPPATH', ROOTPATH . '/tmp');
+define ('QFWPATH', ROOTPATH . '/QFW');
+define ('LIBPATH', ROOTPATH . '/lib');
+define ('MODPATH', APPPATH . '/_common/models');
+
+require (QFWPATH.'/Init.php');
+
+QFW::$router->route();
+
+--EXPECT--
+$_SERVER['HTTP_HOST'] NOT SET
diff --git a/tests/app/020_main_page.phpt b/tests/app/020_main_page.phpt
new file mode 100644
index 0000000..b72436d
--- /dev/null
+++ b/tests/app/020_main_page.phpt
@@ -0,0 +1,11 @@
+--TEST--
+QFW: main page test - default MCA
+--FILE--
+<?php
+require dirname(__FILE__).'/init.php';
+
+QFW::$router->route('');
+
+--EXPECT--
+Основной шаблон
+Корневое действие сайта
diff --git a/tests/app/init.php b/tests/app/init.php
new file mode 100644
index 0000000..a0c53bc
--- /dev/null
+++ b/tests/app/init.php
@@ -0,0 +1,15 @@
+<?php
+ define ('DOC_ROOT', dirname(__FILE__));
+ define ('ROOTPATH', dirname(dirname(dirname(__FILE__))));
+ define ('APPPATH', dirname(dirname(__FILE__)).'/testapp');
+ define ('TMPPATH', ROOTPATH . '/tmp');
+ define ('QFWPATH', ROOTPATH . '/QFW');
+ define ('LIBPATH', ROOTPATH . '/lib');
+ define ('MODPATH', APPPATH . '/_common/models');
+
+ $_SERVER['HTTP_HOST'] = 'test';
+
+ require (QFWPATH.'/Init.php');
+
+
+?>
\ No newline at end of file
diff --git a/tests/testapp/_common/models/.emptydir b/tests/testapp/_common/models/.emptydir
new file mode 100644
index 0000000..625cb36
--- /dev/null
+++ b/tests/testapp/_common/models/.emptydir
@@ -0,0 +1 @@
+models dir
\ No newline at end of file
diff --git a/tests/testapp/_common/slots/.emptydir b/tests/testapp/_common/slots/.emptydir
new file mode 100644
index 0000000..e89abae
--- /dev/null
+++ b/tests/testapp/_common/slots/.emptydir
@@ -0,0 +1 @@
+slots dir
\ No newline at end of file
diff --git a/tests/testapp/_common/tags/.emptydir b/tests/testapp/_common/tags/.emptydir
new file mode 100644
index 0000000..aef7fb2
--- /dev/null
+++ b/tests/testapp/_common/tags/.emptydir
@@ -0,0 +1 @@
+tags dir
\ No newline at end of file
diff --git a/tests/testapp/default/controllers/IndexController.php b/tests/testapp/default/controllers/IndexController.php
new file mode 100644
index 0000000..810f04d
--- /dev/null
+++ b/tests/testapp/default/controllers/IndexController.php
@@ -0,0 +1,18 @@
+<?php
+
+require_once(QFWPATH.'/QuickFW/Auth.php');
+
+class IndexController extends QuickFW_Auth
+{
+ public function __construct()
+ {
+ }
+
+ public function indexAction()
+ {
+ return 'Корневое действие сайта';
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/tests/testapp/default/templates/main.html b/tests/testapp/default/templates/main.html
new file mode 100644
index 0000000..e0a9b74
--- /dev/null
+++ b/tests/testapp/default/templates/main.html
@@ -0,0 +1,2 @@
+Основной шаблон
+<?php echo $content; ?>
diff --git a/tests/testapp/helper b/tests/testapp/helper
new file mode 120000
index 0000000..102313d
--- /dev/null
+++ b/tests/testapp/helper
@@ -0,0 +1 @@
+../../application/helper
\ No newline at end of file
diff --git a/tests/testapp/rewrite.php b/tests/testapp/rewrite.php
new file mode 100644
index 0000000..5a8b367
--- /dev/null
+++ b/tests/testapp/rewrite.php
@@ -0,0 +1,8 @@
+<?php
+
+$rewrite = array(
+);
+$backrewrite = array(
+);
+
+?>
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
QFW/config.php | 4 ++--
tests/app/010_http_host.phpt | 19 +++++++++++++++++++
tests/app/020_main_page.phpt | 11 +++++++++++
www/index.php => tests/app/init.php | 14 ++++++--------
.../testapp}/_common/models/.emptydir | 0
.../testapp}/_common/slots/.emptydir | 0
.../testapp}/_common/tags/.emptydir | 0
.../default/controllers/IndexController.php | 18 ++++++++++++++++++
tests/testapp/default/templates/main.html | 2 ++
tests/testapp/helper | 1 +
{application => tests/testapp}/rewrite.php | 0
11 files changed, 59 insertions(+), 10 deletions(-)
create mode 100644 tests/app/010_http_host.phpt
create mode 100644 tests/app/020_main_page.phpt
copy www/index.php => tests/app/init.php (61%)
copy {application => tests/testapp}/_common/models/.emptydir (100%)
copy {application => tests/testapp}/_common/slots/.emptydir (100%)
copy {application => tests/testapp}/_common/tags/.emptydir (100%)
create mode 100644 tests/testapp/default/controllers/IndexController.php
create mode 100644 tests/testapp/default/templates/main.html
create mode 120000 tests/testapp/helper
copy {application => tests/testapp}/rewrite.php (100%)
hooks/post-receive
--
quickfw
|