and well documented • Installable via Composer, PEAR, and Phar Features: • Mocking • Assertions • Setup/teardown • Annotations • Data providers • Code coverage • Selenium integration • Etc.
2. Interpreting test output 3. IDE Conveniences 4. Examining code coverage 5. Real test examples 6. Update some tests https://github.com/aws/aws-sdk-php
Make each test independent • Mock external state and services • Name your tests after their intention • Use good OOP and DRY principles • Write your code to be testable
dependencies through their constructors, methods, or fields. class Mailer { protected $transport; public function __construct( TransportInterface $transport ) { $this-‐>transport = $transport; } } “ ”
build and test processes • Continuous Integration Systems Jenkins CI • Travis CI • Xinc phpUnderControl • Bamboo • More tools: phpmd, phpcpd, phpcs (see http://phpqatools.org)
written before the implementation • Short-development cycle; Agile methods • Test-writing is part of the design process BDD – Behavior-driven development • Extends TDD; focuses on acceptance testing • Business requirements define behaviors • Behat or phpspec are the main PHP tools