Trimming Things Up in v0.11.1 and PHPUnit
A new version of the Recess PHP Framework has been pushed up to Github, tagged, and is ready for download (zip or tarball)!
There are a number of bug fixes included in this release. Some have been talked about in the previous post. The rest are centered primarily around database stability and improved MySQL support. Thanks to all of you who submitted bugs to Lighthouse or suggestions on the discussion board.
Changes to v0.11.1 that are not bug-fixes are the removal of 3rd party packages SimpleUnit and Smarty and shifting the supported unit testing framework from SimpleTest to PHPUnit. Though SimpleTest served us well for initial development purposes it's just not as robust or well supported as PHPUnit is. Moving the unit tests from SimpleTest to PHPUnit made for a fun, all-night project and led to a better testing suite. Now all database unit tests are executed on both MySQL and Sqlite without any manual switching. This allowed us to remove SimpleTest from the package and reduces Recess' footprint. Instructions for getting PHPUnit tests running
The other big 3rd party package to get moved outside of the source tree is Smarty. Smarty support can now be achieved through an add-on download (zip or tarball). Removing these two 3rd-party packages has trimmed the size of Recess significantly: the v0.10 tarball was 490kb, v0.11.1 is 67kb. Though Smarty users now have an extra step and folks interested in running unit tests will need PHPUnit, the experience for average users should improve with a smaller footprint and less loose files that go unused. At some point we may move the unit tests out of the main distributable and into a "Recess Hackers" distributable, but for now they're bundled with the code.
Running the Recess Unit Tests with PHPUnit
In order to run the unit tests for Recess take the following steps:
- Install PEAR – Typically this is done by executing the go-pear script in your PHP installation directory.
- Install PHPUnit (Instructions)
- First add the PHPUnit channel to PEAR:
pear channel-discover pear.phpunit.de - Next install PHPUnit with
pear install phpunit/PHPUnit
- First add the PHPUnit channel to PEAR:
- Setup MySQL & DSN for Database Tests
- The default MySQL test DSN is localhost,dbname=recess, user=recess, password=recess
- To use settings other than default modify
recess/test/recess/database/PdoDsnSettings.php
- At a command prompt,navigate to recess/test/
- Run the Unit Tests: phpunit —bootstrap bootstrap.php AllTests.php
To contribute unit tests to Recess, fork the source on Git Hub, commit your unit tests to the fork, and request a pull from Recess. Happy testing!
Comments
Recess can only be as good as the thoughts that go into it. Let us hear yours...