Re: [SMARTY-DEV] [patch] bringing Smarty unit tests to PHPunit 3
[email protected] (Sebastian Mendel) Wed, 13 Jun 2007 10:32:45 +0200
| Newsgroups | php.smarty.dev |
|---|---|
| Message-ID | <[email protected]> |
--------------070805080709050905060809 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sebastian Mendel schrieb: > Hi, > > this will update your unit testing suite to work with PHPunit 3 > > i also added some trim around Smarty returned values to remove trailing line > breaks - as i don't think that this will do any harm > > this makes smarty_unit_test.php and smarty_unit_test_gui.php obsolete adjusted the README -- Sebastian Mendel www.sebastianmendel.de --------------070805080709050905060809 Content-Type: text/plain; name="smarty_unit_test_phpunit3_readme.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="smarty_unit_test_phpunit3_readme.patch" Index: unit_test/README =================================================================== RCS file: /repository/smarty/unit_test/README,v retrieving revision 1.1 diff -u -r1.1 README --- unit_test/README 16 Jan 2004 22:12:08 -0000 1.1 +++ unit_test/README 13 Jun 2007 08:31:39 -0000 @@ -1,15 +1,26 @@ Smarty Unit Testing ------------------- -Smarty unit tests require the PEAR PHPUnit +Smarty unit tests require the PHPUnit 3 package to be installed. See if you have that installed with the following command: -$> pear list +$> pear list -c PHPUnit If you don't see PHPUnit, install with this: -$> pear install PHPUnit +The PEAR channel (pear.phpunit.de) that is used to distribute PHPUnit needs to +be registered with the local PEAR environment: + +$> pear channel-discover pear.phpunit.de + +This has to be done only once. Now the PEAR Installer can be used to install +packages from the PHPUnit channel: + +$> pear install phpunit/PHPUnit + +After the installation you can find the PHPUnit source files inside your local +PEAR directory; the path is usually /usr/lib/php/PHPUnit. Edit the config.php file, be sure everything is defined correctly. @@ -22,10 +33,10 @@ cache (writable) Then run from the command line: -php -q smarty_unit_test.php +php -q AllTests.php Or from the web browser: -http://www.your_domain.com/path/to/smarty_unit_test_gui.php +http://www.your_domain.com/path/to/AllTests.php This will run a unit test for every component of Smarty and dump the results. All should pass --------------070805080709050905060809--