diff --git a/NEWS b/NEWS index 90e91106..689c584e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +Version 2.6.1 (Jan 16, 2004) +---------------------------- + - rename $smarty->tpl_error_reporting to $smarty->error_reporting (messju) - fix interpretation of $smarty->security in {html_image} (messju) diff --git a/libs/Config_File.class.php b/libs/Config_File.class.php index 580757a4..c15e7885 100644 --- a/libs/Config_File.class.php +++ b/libs/Config_File.class.php @@ -24,7 +24,7 @@ * http://smarty.php.net/ * * @link http://smarty.php.net/ - * @version 2.6.1 + * @version 2.6.2-dev * @copyright Copyright: 2001-2003 ispi of Lincoln, Inc. * @author Andrei Zmievski * @access public diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index b618b4b1..a470fd74 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -40,7 +40,7 @@ * @author Monte Ohrt * @author Andrei Zmievski * @package Smarty - * @version 2.6.1 + * @version 2.6.2-dev */ /* $Id$ */ @@ -480,7 +480,7 @@ class Smarty * * @var string */ - var $_version = '2.6.1'; + var $_version = '2.6.2-dev'; /** * current template inclusion depth diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index f1765a65..d2b70c82 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -34,7 +34,7 @@ * @link http://smarty.php.net/ * @author Monte Ohrt * @author Andrei Zmievski - * @version 2.6.1 + * @version 2.6.2-dev * @copyright 2001-2003 ispi of Lincoln, Inc. * @package Smarty */ diff --git a/unit_test/README b/unit_test/README new file mode 100644 index 00000000..d4d97313 --- /dev/null +++ b/unit_test/README @@ -0,0 +1,32 @@ +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/unit_test/config.php b/unit_test/config.php new file mode 100644 index 00000000..5e7da056 --- /dev/null +++ b/unit_test/config.php @@ -0,0 +1,5 @@ + diff --git a/unit_test/smarty_unit_test.php b/unit_test/smarty_unit_test.php new file mode 100644 index 00000000..c56a61a0 --- /dev/null +++ b/unit_test/smarty_unit_test.php @@ -0,0 +1,10 @@ + toString(); +?> diff --git a/unit_test/smarty_unit_test_gui.php b/unit_test/smarty_unit_test_gui.php new file mode 100644 index 00000000..03309d4c --- /dev/null +++ b/unit_test/smarty_unit_test_gui.php @@ -0,0 +1,10 @@ + toHTML(); +?> diff --git a/unit_test/test_case.php b/unit_test/test_case.php new file mode 100644 index 00000000..903d0a45 --- /dev/null +++ b/unit_test/test_case.php @@ -0,0 +1,87 @@ +PHPUnit_TestCase($name); + } + // 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; + } + // 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); + } + // 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)); + } + + } +?> diff --git a/unit_test/test_cases.php b/unit_test/test_cases.php new file mode 100644 index 00000000..ac32cf1b --- /dev/null +++ b/unit_test/test_cases.php @@ -0,0 +1,88 @@ +PHPUnit_TestCase($name); + } + // 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; + } + // 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); + } + // 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)); + } + + } +?>