Archive for November, 2009

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 […]

PHPUnit and Mock Object Exactly Method

Sunday, November 1st, 2009

<?php$mapper->expects($this->exactly(‘2′))->method(‘delete’);
$mapper->expects($this->exactly(2))->method(‘delete’);
?>

The two above lines of code don’t behave the same. When passing in 2 as a string instead of a number, PHPUnit declares it a failure:

Em_Model_Collection_MapperTest::testDeleteCollectionWithJoinTable
Expectation failed for method name is equal to when invoked 2 time(s).
Method was expected to be called 2 times, actually called 2 times.