Archive for the 'Zend Framework' Category

Mocking Objects with Final Methods in PHPUnit

Wednesday, July 7th, 2010

Having some issues with a mock in PHPUnit - the method on the mocked object was being called and the code run (bootstrap method on Zend_Application_Bootstrap_BootstrapAbstract). After some head scratching, I realized it was a final method, so PHPUnit can’t override it, and thus, the code is executed. I extended Zend_Application_Bootstrap_BootstrapAbstract and overwrote the […]

Zend_Auth and more than one record matches the supplied identity

Sunday, December 13th, 2009

The Zend_Auth Db adapter will fail if you have more than one record returned, which makes sense. However, when I have coded something like this in the past, I would check how many records were returned with a matching username and password. Zend_Auth looks at how many records are returned for the username field regardless […]

Setting up a new Site with Zend Framework Application/Tool

Wednesday, December 2nd, 2009

It’s been awhile since I had to set up a new site with Zend Framework, and I took the chance to play around with Zend_Tool_Project. Following the QuickStart guide, I had a site up and running in no time. But it did take me a little while to figure out how to get my modules […]

Zend_Service_Technorati and Connection Errors

Tuesday, November 3rd, 2009

I had a site that uses Technorati’s API via Zend Framework- i.e. Zend_Service_Technorati. I noticed I am getting TCP connection errors via an exception (Message: Unable to Connect to tcp://api.technorati.com:80. Error #111: Connection refused), and upon going to Technorati’s site to look at the API, I found out the new API is under works […]

Zend_Acl with User Specific Permissions

Sunday, August 23rd, 2009

There are many articles around explaining Zend_Acl and how to use it within a CMS like system where generic roles apply - i.e. an admin can do anything, a guest can leave a comment and an author can write articles. But I was having a hard time figuring out how to elegantly enforce user specific […]