diff --git a/_posts/01-04-01-Mac-Setup.md b/_posts/01-04-01-Mac-Setup.md index 740fca9..a568bd3 100644 --- a/_posts/01-04-01-Mac-Setup.md +++ b/_posts/01-04-01-Mac-Setup.md @@ -4,9 +4,11 @@ isChild: true ## Mac Setup -OS X comes prepackaged with PHP. As of Mountain Lion, it is _not_ the current stable version of PHP, though. -You can get the PHP executable through a number of Mac [package managers][mac-package-managers] or [compile it yourself][mac-compile] (if compiling, be sure to have Xcode installed, or Apple's substitute ["Command Line Tools for Xcode" downloadable from Apple's Mac Developer Center][apple-developer]). -For a complete LAMP package with GUI try [MAMP2][mamp-downloads], otherwise consider [Entropy 5.4 package][entropy-downloads]. +OSX comes prepackaged with PHP but it is normally a little behind the latest stable. Lion comes with PHP 5.3.6 and Mountain Lion has 5.3.10. + +To update PHP on OSX you can get the PHP executable through a number of Mac [package managers][mac-package-managers] or [compile it yourself][mac-compile] (if compiling, be sure to have installed either Xcode or Apple's substitute ["Command Line Tools for Xcode" downloadable from Apple's Mac Developer Center][apple-developer]). + +For a complete LAMP package with GUI try [MAMP][mamp-downloads], otherwise consider the [Entropy 5.4][entropy-downloads] package. [mac-package-managers]: http://www.php.net/manual/en/install.macosx.packages.php [mac-compile]: http://www.php.net/manual/en/install.macosx.compile.php diff --git a/_posts/07-01-01-Testing.md b/_posts/07-01-01-Testing.md index 60ae0f6..b2e74ae 100644 --- a/_posts/07-01-01-Testing.md +++ b/_posts/07-01-01-Testing.md @@ -2,10 +2,8 @@ Writing automated tests for your PHP code is considered a best practice and can lead to well-built applications. Automated tests are a great tool for making sure your application -does not break when you are making changes or adding new functionality. +does not break when you are making changes or adding new functionality and should not be ignored. -Some common tools are: - -* [PHPUnit](http://phpunit.de) -* [Behat](http://behat.org) -* [Selenium](http://seleniumhq.org/) +There are several different types of testing tools (or frameworks) available for PHP, which use +different approaches - all of which are trying to avoid manual testing and the need for large +Quality Assurance teams, just to make sure recent changes didn't break existing functionality. \ No newline at end of file diff --git a/_posts/07-02-01-Test-Driven-Development.md b/_posts/07-02-01-Test-Driven-Development.md new file mode 100644 index 0000000..7cbc98a --- /dev/null +++ b/_posts/07-02-01-Test-Driven-Development.md @@ -0,0 +1,31 @@ +--- +isChild: true +--- + +## Test Driven Development + +Unit Testing is a programatical approach to ensure functions, classes and methods are working as +expected, from the point you build them all the way through to the development cycle. By checking +values going in and out of various functions and methods, you can make sure the internal logic is +working correctly. By using Dependecy Injection and building "mock" classes you can check internal +parameter values for even better test coverage. + +When you create a class or function you should create a unit test for it. At a very basic level you should +make sure it errors if you send it bad arguments and make sure it works if you send it valid arguments. +This will help ensure that when you make changes to this class or function later on in the development +cycle that the old functionality continues to work as expected. The only alternative to this would be +var_dump() in a test.php, which is no way to build an application - large or small. + +The other use for unit tests is contributing to open source. If you can write a test that shows broken +functionality, then fix it, and show the test working, patches are much more likely to be accepted. If +you run a project who accepts pull requests, you should suggest this as a requirement for pull requests. + +PHPUnit is the most popular and has become a de facto standard with its popular adoption amongst [PHP +frameworks][phpfws] and [Composer][composer] component developers, but there are a few alternatives around. + +* [PHPUnit](http://phpunit.de/) +* [Enhance PHP](http://www.enhance-php.com/) +* [PUnit](http://punit.smf.me.uk/) + +[phpfws]: /#libraries_and_frameworks +[composer]: /#composer_and_packagist \ No newline at end of file diff --git a/_posts/07-03-01-Behavior-Driven-Development.md b/_posts/07-03-01-Behavior-Driven-Development.md new file mode 100644 index 0000000..3f58f66 --- /dev/null +++ b/_posts/07-03-01-Behavior-Driven-Development.md @@ -0,0 +1,11 @@ +--- +isChild: true +--- + +## Behaviour Driven Development + +With BDD, you write human-readable stories that describe the behavior of your application. These stories +can then be run as actual tests against your application. + +* [Behat](http://behat.org/) is inspired by Ruby's [Cucumber](http://cukes.info/) project +* [Selenium](http://seleniumhq.org/) is a browser automation tool, which automates the "clicking around the site" method of testing. It can also be [combined with PHPUnit](http://www.phpunit.de/manual/3.1/en/selenium.html) \ No newline at end of file