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 25b39c23eeb4f1884e7adb119b7cac1f99ac2a9f (commit)
via a1bd27ac269de99aceaecebbb1aabbd7112779b1 (commit)
via 9b89af82040662b4b66ed59ecef563b09bdf24a3 (commit)
from e38332209fb0516ed4b399386641e66f7c848cfd (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 25b39c23eeb4f1884e7adb119b7cac1f99ac2a9f
Author: Ivan Borzenkov <iva...@li...>
Date: Sat Aug 28 23:18:59 2010 +0400
Тест двойного запуска
diff --git a/tests/app/050_double_run.phpt b/tests/app/050_double_run.phpt
new file mode 100644
index 0000000..a796dc9
--- /dev/null
+++ b/tests/app/050_double_run.phpt
@@ -0,0 +1,15 @@
+--TEST--
+QFW: double run route
+--FILE--
+<?php
+require dirname(__FILE__).'/init.php';
+
+QFW::$router->route('');
+echo "\n";
+QFW::$router->route('');
+
+--EXPECT--
+Основной шаблон
+Корневое действие сайта
+Основной шаблон
+Корневое действие сайта
commit a1bd27ac269de99aceaecebbb1aabbd7112779b1
Author: Ivan Borzenkov <iva...@li...>
Date: Sat Aug 28 23:18:43 2010 +0400
В базовый урл добавил параметр
diff --git a/QFW/QuickFW/Url.php b/QFW/QuickFW/Url.php
index 280d1d0..63c22d5 100644
--- a/QFW/QuickFW/Url.php
+++ b/QFW/QuickFW/Url.php
@@ -8,13 +8,14 @@
class Url
{
/**
- * Возвращает базовый урл
+ * Добавляет в начале базовый урл
*
+ * @param string|self $url url
* @return self базовый url
*/
- public static function base()
+ public static function base($url='')
{
- return new self('');
+ return new self('').$url;
}
/**
commit 9b89af82040662b4b66ed59ecef563b09bdf24a3
Author: Ivan Borzenkov <iva...@li...>
Date: Wed Aug 25 21:12:47 2010 +0400
Перетасовка тестов
diff --git a/tests/QFW/FrameworkTests.php b/tests/QFW/FrameworkTests.php
deleted file mode 100644
index bf0ed60..0000000
--- a/tests/QFW/FrameworkTests.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-require_once ('PHPUnit/Framework/TestSuite.php');
-
-class FrameworkTests
-{
- public static function suite()
- {
- $suite = new PHPUnit_Framework_TestSuite();
-
- $base = dirname(__FILE__);
-
- $suite->addTestFile($base.'/QFWTest.php');
-
- return $suite;
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tests/QFW/QFWTest.php b/tests/QFW/QFWTest.php
deleted file mode 100644
index 5e8b459..0000000
--- a/tests/QFW/QFWTest.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-class QFWTest extends PHPUnit_Framework_TestCase
-{
- public function testInitTime()
- {
- global $InitTime;
- $this->assertLessThanOrEqual(0.01, $InitTime);
- unset($GLOBALS['InitTime']);
- }
-
- /**
- * Соответствия урлам и дефолтным урлам
- *
- * @return array
- */
- public function testDdefProvider()
- {
- return array(
- array('aaa/bbb/ccc', ''),
- array('aaa/bbb/fff', 'bbb/fff'),
- array('aaa/eee/ccc', 'eee'),
- array('aaa/eee/fff', 'eee/fff'),
- array('ddd/bbb/ccc', 'ddd/bbb'),
- array('ddd/bbb/fff', 'ddd/bbb/fff'),
- array('ddd/eee/ccc', 'ddd/eee'),
- array('ddd/eee/fff', 'ddd/eee/fff'),
- array('aaa/bbb', ''),
- array('aaa/eee', 'eee'),
- array('ddd/bbb', 'ddd/bbb'),
- array('ddd/eee', 'ddd/eee'),
- array('aaa/ccc', ''),
- array('aaa/fff', 'fff'),
- array('ddd/ccc', 'ddd'),
- array('ddd/fff', 'ddd/fff'),
- array('bbb/ccc', ''),
- array('bbb/fff', 'bbb/fff'),
- array('eee/ccc', 'eee'),
- array('eee/fff', 'eee/fff'),
- array('aaa', ''),
- array('ddd', 'ddd'),
- array('bbb', ''),
- array('eee', 'eee'),
- array('ccc', ''),
- array('fff', 'fff'),
- );
- }
-
- /**
- * @dataProvider testDdefProvider
- *
- * Тестирование delDef
- */
- public function testDdef($in, $out)
- {
- QFW::Init();
- QFW::$config['default']['module'] = 'aaa';
- QFW::$config['default']['controller'] = 'bbb';
- QFW::$config['default']['action'] = 'ccc';
- QFW::$router->__construct(APPPATH);
- $this->assertEquals(QFW::$router->delDef($in),$out);
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/tests/QFWTests.php b/tests/QFWTests.php
index 2a355af..5b1a6b1 100644
--- a/tests/QFWTests.php
+++ b/tests/QFWTests.php
@@ -23,8 +23,6 @@
$suite->addTestFile('DbSimple/DbSimpleTests.php');
$suite->addTestFile('Cache/CacheTest.php');
- //$suite->addTestFile('Smarty/SmartyTest.php');
- $suite->addTestFile('QFW/FrameworkTests.php');
return $suite;
}
diff --git a/tests/Smarty/README b/tests/Smarty/README
deleted file mode 100644
index d4d9731..0000000
--- a/tests/Smarty/README
+++ /dev/null
@@ -1,32 +0,0 @@
-Smarty Unit Testing
--------------------
-
-Smarty unit tests require the PEAR PHPUnit
-package to be installed. See if you have that
-installed with the following command:
-
-$> pear list
-
-If you don't see PHPUnit, install with this:
-
-$> pear install PHPUnit
-
-Edit the config.php file,
-be sure everything is defined correctly.
-
-Be sure the following directories are present:
-
-templates
-configs
-templates_c (writable)
-cache (writable)
-
-Then run from the command line:
-php -q smarty_unit_test.php
-
-Or from the web browser:
-http://www.your_domain.com/path/to/smarty_unit_test_gui.php
-
-This will run a unit test for every component
-of Smarty and dump the results. All should pass
-with flying colors. :)
diff --git a/tests/Smarty/SmartyTest.php b/tests/Smarty/SmartyTest.php
deleted file mode 100644
index d34a99f..0000000
--- a/tests/Smarty/SmartyTest.php
+++ /dev/null
@@ -1,449 +0,0 @@
-<?php
-
-
-class SmartyObj {
- var $val = 'val';
- var $arr = array('one' => 'one', 'two' => 2);
- var $ten = 10;
-
- function meth($a="a", $b="b") {
- return "$a:$b";
- }
-
- function six() {
- return 6;
- }
-}
-
-require_once LIBPATH . '/Smarty/Smarty.class.php';
-
-class SmartyTest extends PHPUnit_Framework_TestCase
-{
- // contains the SmartyObject handle of the string class
- var $abc;
- // contains the last triggered error's errorlevel
- var $errorlevel;
-
- // called before the test functions will be executed
- // this function is defined in PHPUnit_TestCase and overwritten
- // here
- function setUp() {
- // create a new instance of String with the
- // string 'abc'
- $this->smarty = new Smarty;
- $this->smarty->template_dir = dirname(__FILE__).'/templates';
- $this->smarty->config_dir = dirname(__FILE__).'/configs';
- $this->smarty->compile_dir = dirname(__FILE__).'/templates_c';
- $this->smarty->cache_dir = dirname(__FILE__).'/cache';
- $this->smarty->plugins_dir = array(LIBPATH . '/Smarty/plugins');
- }
- // called after the test functions are executed
- // this function is defined in PHPUnit_TestCase and overwritten
- // here
- function tearDown() {
- // delete your instance
- unset($this->smarty);
- }
-
- // dummy errorhandler for functions that are supposed to call trigger_error()
- function error_handler($errorlevel) {
- if ($errorlevel) $this->errorlevel = $errorlevel;
- }
-
- /* DIRECTORY TESTS */
-
- // test that template_dir exists
- function test_template_dir_exists() {
- $this->assertTrue(file_exists($this->smarty->template_dir));
- }
- // test that template_dir is a directory
- function test_template_dir_is_dir() {
- $this->assertTrue(is_dir($this->smarty->template_dir));
- }
- // test that template_dir is readable
- function test_template_dir_is_readable() {
- $this->assertTrue(is_readable($this->smarty->template_dir));
- }
- // test that config_dir exists
- function test_config_dir_exists() {
- $this->assertTrue(file_exists($this->smarty->config_dir));
- }
- // test that config_dir is a directory
- function test_config_dir_is_dir() {
- $this->assertTrue(is_dir($this->smarty->config_dir));
- }
- // test that config_dir is readable
- function test_config_dir_is_readable() {
- $this->assertTrue(is_readable($this->smarty->config_dir));
- }
- // test that compile_dir exists
- function test_compile_dir_exists() {
- $this->assertTrue(file_exists($this->smarty->compile_dir));
- }
- // test that compile_dir is a directory
- function test_compile_dir_is_dir() {
- $this->assertTrue(is_dir($this->smarty->compile_dir));
- }
- // test that compile_dir is readable
- function test_compile_dir_is_readable() {
- $this->assertTrue(is_readable($this->smarty->compile_dir));
- }
- // test that compile_dir is writable
- function test_compile_dir_is_writable() {
- $this->assertTrue(is_writable($this->smarty->compile_dir));
- }
- // test that cache_dir exists
- function test_cache_dir_exists() {
- $this->assertTrue(file_exists($this->smarty->cache_dir));
- }
- // test that cache_dir is a directory
- function test_cache_dir_is_dir() {
- $this->assertTrue(is_dir($this->smarty->cache_dir));
- }
- // test that cache_dir is readable
- function test_cache_dir_is_readable() {
- $this->assertTrue(is_readable($this->smarty->cache_dir));
- }
- // test that cache_dir is writable
- function test_cache_dir_is_writable() {
- $this->assertTrue(is_writable($this->smarty->cache_dir));
- }
-
- /* METHOD EXISTS TESTS */
- function test_assign_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'assign'));
- }
- function test_assign_by_ref_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'assign_by_ref'));
- }
- function test_append_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'append'));
- }
- function test_append_by_ref_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'append_by_ref'));
- }
- function test_clear_assign_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'clear_assign'));
- }
- function test_register_function_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_function'));
- }
- function test_unregister_function_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_function'));
- }
- function test_register_object_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_object'));
- }
- function test_unregister_object_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_object'));
- }
- function test_register_block_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_block'));
- }
- function test_unregister_block_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_block'));
- }
- function test_register_compiler_function_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_compiler_function'));
- }
- function test_unregister_compiler_function_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_compiler_function'));
- }
- function test_register_modifier_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_modifier'));
- }
- function test_unregister_modifier_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_modifier'));
- }
- function test_register_resource_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_resource'));
- }
- function test_unregister_resource_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_resource'));
- }
- function test_register_prefilter_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_prefilter'));
- }
- function test_unregister_prefilter_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_prefilter'));
- }
- function test_register_postfilter_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_postfilter'));
- }
- function test_unregister_postfilter_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_postfilter'));
- }
- function test_register_outputfilter_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'register_outputfilter'));
- }
- function test_unregister_outputfilter_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'unregister_outputfilter'));
- }
- function test_load_filter_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'load_filter'));
- }
- function test_clear_cache_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'clear_cache'));
- }
- function test_clear_all_cache_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'clear_all_cache'));
- }
- function test_is_cached_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'is_cached'));
- }
- function test_clear_all_assign_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'clear_all_assign'));
- }
- function test_clear_compiled_tpl_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'clear_compiled_tpl'));
- }
- function test_template_exists_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'template_exists'));
- }
- function test_get_template_vars_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'get_template_vars'));
- }
- function test_get_config_vars_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'get_config_vars'));
- }
- function test_trigger_error_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'trigger_error'));
- }
- function test_display_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'display'));
- }
- function test_fetch_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'fetch'));
- }
- function test_config_load_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'config_load'));
- }
- function test_get_registered_object_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'get_registered_object'));
- }
- function test_clear_config_method_exists() {
- $this->assertTrue(method_exists($this->smarty, 'clear_config'));
- }
- function test_get_plugin_filepath() {
- $this->assertTrue(method_exists($this->smarty, '_get_plugin_filepath'));
- }
-
-
- /* DISPLAY TESTS */
-
- // test that display() executes properly
- function test_call_to_display() {
- ob_start();
- $this->smarty->display('index.tpl');
- $output = ob_get_contents();
- ob_end_clean();
- $this->assertEquals($output, 'TEST STRING');
- }
-
- /* FETCH TESTS */
-
- // test that fetch() executes properly
- function test_call_to_fetch() {
- $this->assertEquals($this->smarty->fetch('index.tpl'), 'TEST STRING');
- }
-
- /* ASSIGN TESTS */
-
- // test assigning a simple template variable
- function test_assign_var() {
- $this->smarty->assign('foo', 'bar');
- $this->assertEquals($this->smarty->fetch('assign_var.tpl'), 'bar');
- }
-
- /* PARSING TESTS */
-
- // test assigning and calling an SmartyObject
- function test_parse_obj_meth() {
- $obj = new SmartyObj();
- $this->smarty->assign('obj', $obj);
- $this->smarty->assign('foo', 'foo');
- $this->assertEquals('foo:2.5
-2.5:foo
-2.5:b
-val:foo
-foo:val
-foo:foo
-one:2
-foo:foo:b', $this->smarty->fetch('parse_obj_meth.tpl'));
- }
-
- // test assigning and calling an SmartyObject
- function test_parse_math() {
- $obj = new SmartyObj();
- $this->smarty->assign('obj', $obj);
- $this->smarty->assign('flt', 2.5);
- $this->smarty->assign('items', array(1, 2));
- $this->assertEquals('3
-3.5
-7
-11
-4
-4.5
-8
-12
-12.5
-25
-16
-20
-8.5
-7', $this->smarty->fetch('parse_math.tpl'));
- }
-
- /* CONFIG FILE TESTS */
-
- // test assigning a double quoted global variable
- function test_config_load_globals_double_quotes() {
- // load the global var
- $this->smarty->config_load('globals_double_quotes.conf');
- // test that it is assigned
- $this->assertEquals($this->smarty->_config[0]['vars']['foo'], 'bar');
- }
-
- // test assigning a single quoted global variable
- function test_config_load_globals_single_quotes() {
- // load the global var
- $this->smarty->config_load('globals_single_quotes.conf');
- // test that it is assigned
- $this->assertEquals($this->smarty->_config[0]['vars']['foo'], 'bar');
- }
-
- // test loading and running modifier.escape.php
- function test_escape_modifier_get_plugins_filepath() {
- $filepath = $this->smarty->_get_plugin_filepath('modifier', 'escape');
- $this->assertTrue(!!$filepath);
- }
-
- function test_escape_modifier_include_file() {
- $filepath = $this->smarty->_get_plugin_filepath('modifier', 'escape');
- $this->assertTrue(!!include($filepath));
- }
-
- function test_escape_modifier_function_exists() {
- $this->assertTrue(function_exists('smarty_modifier_escape'));
- }
-
- function test_escape_modifier_escape_default() {
- $string = smarty_modifier_escape("<html><body></body></html>");
- $this->assertEquals('<html><body></body></html>',
- $string);
- }
-
- function test_escape_modifier_escape_html() {
- $string = smarty_modifier_escape("<html><body></body></html>", 'html');
- $this->assertEquals('<html><body></body></html>',
- $string);
- }
-
- function test_escape_modifier_escape_htmlall() {
- $string = smarty_modifier_escape("<html><body></body></html>", 'htmlall');
- $this->assertEquals('<html><body></body></html>',
- $string);
- }
-
- function test_escape_modifier_escape_url() {
- $string = smarty_modifier_escape("http://test.com?foo=bar", 'url');
- $this->assertEquals('http%3A%2F%2Ftest.com%3Ffoo%3Dbar', $string);
- }
-
- function test_escape_modifier_escape_quotes() {
- $string = smarty_modifier_escape("'\\'\\''", 'quotes');
- $this->assertEquals("\\'\\'\\'\\'", $string);
- }
-
- function test_escape_modifier_escape_hex() {
- $string = smarty_modifier_escape("abcd", 'hex');
- $this->assertEquals('%61%62%63%64', $string);
- }
-
- function test_escape_modifier_escape_hexentity() {
- $string = smarty_modifier_escape("ABCD", 'hexentity');
- $this->assertEquals('ABCD', $string);
- }
-
- function test_escape_modifier_escape_javascript() {
- $string = smarty_modifier_escape("\r\n\\", 'javascript');
- $this->assertEquals('\\r\\n\\\\', $string);
- }
-
-
- function test_core_is_secure_file_exists() {
- $file = SMARTY_CORE_DIR . 'core.is_secure.php';
- $this->assertTrue(file_exists($file));
- }
-
- function test_core_is_secure_file_include() {
- $file = SMARTY_CORE_DIR . 'core.is_secure.php';
- $this->assertTrue(!!include($file));
- }
-
- function test_core_is_secure_function_exists() {
- $this->assertTrue(function_exists('smarty_core_is_secure'));
- }
-
- function test_core_is_secure_function_is_secure_true() {
- $security = $this->smarty->security;
- $this->smarty->security = true;
-
- /* check if index.tpl is secure (should be true) */
- $params = array('resource_type' => 'file',
- 'resource_base_path' => dirname(__FILE__) . '/templates',
- 'resource_name' => dirname(__FILE__) . '/templates/index.tpl');
- $this->assertTrue(smarty_core_is_secure($params, $this->smarty));
- $this->smarty->security = $security;
- }
-
- function test_core_is_secure_function_is_secure_false() {
- $security = $this->smarty->security;
- $this->smarty->security = true;
- /* check if test_cases.php is secure (should be false) */
- $params = array('resource_type' => 'file',
- 'resource_base_path' => dirname(__FILE__) . '/templates',
- 'resource_name' => __FILE__);
- $this->assertFalse(smarty_core_is_secure($params, $this->smarty));
- $this->smarty->security = $security;
-
- }
-
- // test constants and security
- function test_core_is_secure_function_smarty_var_const() {
- define('TEST_CONSTANT', 'test constant');
- $this->assertEquals('test constant', $this->smarty->fetch('constant.tpl',
- null, 'var_const'));
- }
-
- function test_core_is_secure_function_smarty_var_const_allowed() {
- $security = $this->smarty->security;
- $security_settings = $this->smarty->security_settings;
- $this->smarty->security_settings['ALLOW_CONSTANTS'] = true;
- $this->smarty->security = true;
- $this->assertEquals('test constant', $this->smarty->fetch('constant.tpl',
- null, 'var_const_allowed'));
- $this->smarty->security_settings = $security_settings;
- $this->smarty->security = $security;
- }
-
- function test_core_is_secure_function_smarty_var_const_not_allowed() {
- $security = $this->smarty->security;
- $this->smarty->security = true;
- /* catch errors: */
- $this->errorlevel = null;
- set_error_handler(array(&$this, 'error_handler'));
- $this->smarty->fetch('constant.tpl', null, 'var_const_not_allowed');
- restore_error_handler();
-
- $this->assertEquals( $this->errorlevel, E_USER_WARNING);
- $this->smarty->security = $security;
- }
-
- function test_clear_compiled_tpl() {
- $this->smarty->clear_compiled_tpl();
- }
-
-}
-
-?>
diff --git a/tests/Smarty/configs/globals_double_quotes.conf b/tests/Smarty/configs/globals_double_quotes.conf
deleted file mode 100644
index 5abc475..0000000
--- a/tests/Smarty/configs/globals_double_quotes.conf
+++ /dev/null
@@ -1 +0,0 @@
-foo = "bar"
diff --git a/tests/Smarty/configs/globals_single_quotes.conf b/tests/Smarty/configs/globals_single_quotes.conf
deleted file mode 100644
index 4517b7b..0000000
--- a/tests/Smarty/configs/globals_single_quotes.conf
+++ /dev/null
@@ -1 +0,0 @@
-foo = 'bar'
diff --git a/tests/Smarty/templates/assign_var.tpl b/tests/Smarty/templates/assign_var.tpl
deleted file mode 100644
index acc4b66..0000000
--- a/tests/Smarty/templates/assign_var.tpl
+++ /dev/null
@@ -1 +0,0 @@
-{$foo}
diff --git a/tests/Smarty/templates/constant.tpl b/tests/Smarty/templates/constant.tpl
deleted file mode 100644
index 7ae11f1..0000000
--- a/tests/Smarty/templates/constant.tpl
+++ /dev/null
@@ -1 +0,0 @@
-{$smarty.const.TEST_CONSTANT}
diff --git a/tests/Smarty/templates/index.tpl b/tests/Smarty/templates/index.tpl
deleted file mode 100644
index fb6aad2..0000000
--- a/tests/Smarty/templates/index.tpl
+++ /dev/null
@@ -1 +0,0 @@
-TEST STRING
diff --git a/tests/Smarty/templates/parse_math.tpl b/tests/Smarty/templates/parse_math.tpl
deleted file mode 100644
index 0b787d3..0000000
--- a/tests/Smarty/templates/parse_math.tpl
+++ /dev/null
@@ -1,12 +0,0 @@
-{foreach name=loop from=$items item=i}
-{$smarty.foreach.loop.iteration+2}
-{$smarty.foreach.loop.iteration+$flt}
-{$smarty.foreach.loop.iteration+$obj->six()}
-{$smarty.foreach.loop.iteration+$obj->ten}
-{/foreach}
-{$obj->ten+$flt}
-{$obj->ten*$flt}
-{$obj->six()+$obj->ten}
-{$obj->ten+$obj->ten}
-{$obj->six()+$flt}
-{$obj->six()+$items.0}
diff --git a/tests/Smarty/templates/parse_obj_meth.tpl b/tests/Smarty/templates/parse_obj_meth.tpl
deleted file mode 100644
index ab19832..0000000
--- a/tests/Smarty/templates/parse_obj_meth.tpl
+++ /dev/null
@@ -1,8 +0,0 @@
-{$obj->meth($foo, 2.5)}
-{$obj->meth(2.5, $foo)}
-{$obj->meth(2.5)}
-{$obj->meth($obj->val, "foo")}
-{$obj->meth("foo", $obj->val)}
-{$obj->meth("foo", $foo)}
-{$obj->meth($obj->arr.one, 2)}
-{$obj->meth($obj->meth("foo", $foo))}
diff --git a/tests/app/030_init_time.phpt_ b/tests/app/030_init_time.phpt_
new file mode 100644
index 0000000..199940c
--- /dev/null
+++ b/tests/app/030_init_time.phpt_
@@ -0,0 +1,23 @@
+--TEST--
+QFW: init time (may faild - rerun)
+--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');
+
+$_SERVER['HTTP_HOST'] = 'test';
+
+$InitTime = microtime(true);
+require_once (QFWPATH.'/Init.php');
+$InitTime = microtime(true) - $InitTime;
+
+var_dump($InitTime < 0.01);
+
+--EXPECT--
+bool(true)
diff --git a/tests/app/040_del_def.phpt b/tests/app/040_del_def.phpt
new file mode 100644
index 0000000..0933749
--- /dev/null
+++ b/tests/app/040_del_def.phpt
@@ -0,0 +1,48 @@
+--TEST--
+QFW: test delDef
+--FILE--
+<?php
+require dirname(__FILE__).'/init.php';
+
+QFW::Init();
+QFW::$config['default']['module'] = 'aaa';
+QFW::$config['default']['controller'] = 'bbb';
+QFW::$config['default']['action'] = 'ccc';
+
+$test = array(
+ 'aaa/bbb/ccc' => '',
+ 'aaa/bbb/fff' => 'bbb/fff',
+ 'aaa/eee/ccc' => 'eee',
+ 'aaa/eee/fff' => 'eee/fff',
+ 'ddd/bbb/ccc' => 'ddd/bbb',
+ 'ddd/bbb/fff' => 'ddd/bbb/fff',
+ 'ddd/eee/ccc' => 'ddd/eee',
+ 'ddd/eee/fff' => 'ddd/eee/fff',
+ 'aaa/bbb' => '',
+ 'aaa/eee' => 'eee',
+ 'ddd/bbb' => 'ddd/bbb',
+ 'ddd/eee' => 'ddd/eee',
+ 'aaa/ccc' => '',
+ 'aaa/fff' => 'fff',
+ 'ddd/ccc' => 'ddd',
+ 'ddd/fff' => 'ddd/fff',
+ 'bbb/ccc' => '',
+ 'bbb/fff' => 'bbb/fff',
+ 'eee/ccc' => 'eee',
+ 'eee/fff' => 'eee/fff',
+ 'aaa' => '',
+ 'ddd' => 'ddd',
+ 'bbb' => '',
+ 'eee' => 'eee',
+ 'ccc' => '',
+ 'fff' => 'fff',
+);
+
+QFW::$router->__construct(APPPATH);
+
+foreach($test as $in=>$out)
+ if (QFW::$router->delDef($in) != $out)
+ echo $in.' != '.$out."\n";
+
+
+--EXPECT--
-----------------------------------------------------------------------
Summary of changes:
QFW/QuickFW/Url.php | 7 +-
tests/QFW/FrameworkTests.php | 20 -
tests/QFW/QFWTest.php | 66 ---
tests/QFWTests.php | 2 -
tests/Smarty/README | 32 --
tests/Smarty/SmartyTest.php | 449 --------------------
tests/Smarty/configs/globals_double_quotes.conf | 1 -
tests/Smarty/configs/globals_single_quotes.conf | 1 -
tests/Smarty/templates/assign_var.tpl | 1 -
tests/Smarty/templates/constant.tpl | 1 -
tests/Smarty/templates/index.tpl | 1 -
tests/Smarty/templates/parse_math.tpl | 12 -
tests/Smarty/templates/parse_obj_meth.tpl | 8 -
.../{010_http_host.phpt => 030_init_time.phpt_} | 12 +-
tests/app/040_del_def.phpt | 48 ++
.../{020_main_page.phpt => 050_double_run.phpt} | 6 +-
16 files changed, 65 insertions(+), 602 deletions(-)
delete mode 100644 tests/QFW/FrameworkTests.php
delete mode 100644 tests/QFW/QFWTest.php
delete mode 100644 tests/Smarty/README
delete mode 100644 tests/Smarty/SmartyTest.php
delete mode 100644 tests/Smarty/configs/globals_double_quotes.conf
delete mode 100644 tests/Smarty/configs/globals_single_quotes.conf
delete mode 100644 tests/Smarty/templates/assign_var.tpl
delete mode 100644 tests/Smarty/templates/constant.tpl
delete mode 100644 tests/Smarty/templates/index.tpl
delete mode 100644 tests/Smarty/templates/parse_math.tpl
delete mode 100644 tests/Smarty/templates/parse_obj_meth.tpl
copy tests/app/{010_http_host.phpt => 030_init_time.phpt_} (62%)
create mode 100644 tests/app/040_del_def.phpt
copy tests/app/{020_main_page.phpt => 050_double_run.phpt} (56%)
hooks/post-receive
--
quickfw
|