Using the @ComposedObject Zend Framework 2 Form Annotation

Recently I started playing with Zend Framework 2 Form Annotations which certainly makes building forms much simpler (if you have not heard about this yet see Matthew Weier O’Phinney’s post and the ZF2 Documentation). After getting it up and running I found out about about the @ComposedObject annotation which seemed very useful, however it took a bit of fiddling to get it up and running, here’s how I did it. Continue reading

Getting the ServiceManager into the test environment and Dependency Injection

So far I’ve got the basic idea of how to test a ZF2 Controller with PHPUnit. However I had problems testing all my actions that used the AlbumTable class to load data from the database because I had no access to the ServiceManager which is used to provide AlbumTable to the controller. Obviously solving this was my next step…
Continue reading

Getting PHPUnit working with a Zend Framework 2 MVC application

Now that I’ve got a little MVC application up and running in Zend Framework 2 (see my previous post) I decided it was time to try and get PHPUnit to play with it. While I don’t think I’m alone in wanting to use ZF2 & PHPUnit together it’s certainly something not many people are talking about.

Here I will show how I bootstrapped PHPUnit with the Zend Framework. Continue reading

Getting started with Zend Framework 2

After a little Google search for a good intro into the Zend Framework 2 I came up with Rob Allen aka Akrabat’s tutorial. I’d had a little play with ZF2 before when it was in beta 3 or beta 4 but after opening up beta 5 I was quite surprised to see how much things had changed.

Rob has not yet updated his tutorial but I understand an update is coming very very soon, while meaning that some things in the tutorial didn’t work it gave me the opportunity to do some digging into the Zend Framework code & documentation to get it up and running.


UPDATE!
Rob has now updated his tutorial which you can download from here.


Continue reading

The Plan

So here is little bit about what I hope this blog will be about and why I’m creating it. Hopefully I’ll learn some things in the process and by posting what I learn here it will help others. Also I hope some of you will tell me what I’m doing wrong and give suggestions on improving my methods. Continue reading