December 2nd, 2009
Building on the Introduction to Doctrine 1.2 video, this video will show how you can easily test the persistence of Doctrine models within the Zend_Test environment.
I also touch briefly on how to setup the latest version of MAMP with phpunit.
Edit: I spoke to Guilherme Blanco (one of the core developers behind Doctrine) and he kindly brought up some things I should bear in mind for my Doctrine / Zend set.
Doctrine’s autoloader configuration can be scaled back by doing PEAR style Model Loading (new to 1.2). Also, you can use Doctrine_Core instead of Doctrine since everything has been moved to Doctrine_Core in order to follow Zend-style namespacing.
lastly, you can register your own CLI tasks as part of Doctrine’s CLI script or just write them in the scripts/doctrine.php file. With this, you could have your newly-generated models placed in the necessary folders. I’ll be experimenting with this in the coming week.
Enjoy!
Topics: Working with a Database |
Tags: doctrine, mamp, phpunit, Unit Testing, zend_test
Posted in Working with a Database |
Episode Discussion
June 29th, 2009
This video tutorial is going to look at how we can build a simple authentication mechanism with Zend_Acl with complete unit test coverage. I wouldn’t say that this is entirely the Zend way of doing things since we’re not using Zend_Auth, however it would be relatively trivial to create a Zend_Auth Adapter for each of the lookup objects that we’re going to write. Lately I’ve been trying to stay disciplined about how I’m writing unit tests and so I figure this should translate into what I’m teaching. I inadvertently covered using reflection in a refactoring job. When you browse the source code, you’ll see that there’s even more potential for refactoring outside the video with the application of an interface.
Topics: Unit Testing |
Tags: phpunit, refactoring, reflection, unit tests, unittest, Zend_Acl
Posted in Unit Testing |
11 Comments »
June 11th, 2009
I have to preface this video by saying that I’m still a bit of a novice when it comes to unit testing (especially in Zend). Also, I feel that I wouldn’t be able to take credit for the whole implementation.
Here are some great resources on unit testing in the Zend Framework to beef up your knowledge.
The trouble with these is that they’re mostly pre-1.8. I’ve taken the approach of using a command line instead of the IDE since this way it doesn’t matter if you’re using Zend Studio for Eclipse.
What’s covered:
- Using phpunit with MAMP
- Unit Testing Models
- Generating Code Coverage Reports
- Unit Testing Controllers
Don’t forget to grab the source code or browse it on google code.
Topics: Development Workflow, zend_controller |
Tags: code coverage, phpunit, zend_controller, zend_test
Posted in Development Workflow, zend_controller |
65 Comments »