ZF-7984 – Zend_Tool Exits with Fatal Errors after installing PHPUnit 3.4.0+

I’m lucky enough to have made it to ZendCon again this year, and I’m having a blast learning new stuff, hanging out with old friends, making new friends, and generally grabbing up as much schwag as possible.

One of the topics that I’m most interested in is unit testing, specifically unit testing Zend Framework MVC apps.  While there’s a lot I have yet to learn on that topic, I ran into a bug last night that I wanted to let you know about.

In preparation to dig into ZF unit testing, I updated my install of PHPUnit to the latest version (currently 3.4.1, installed via PEAR).  When I tried to create a new ZF project using Zend_Tool, I received the following error:

jkendall@san-diego:~/dev/www$ zf create project asplode
 
Fatal error: Cannot redeclare class phpunit_framework_testsuite_dataprovider in /usr/share/php/PHPUnit/Framework/TestSuite/DataProvider.php on line 64
 
Call Stack:
    0.0020     111440   1. {main}() /usr/share/phplib/ZendFramework-1.9.3PL1/bin/zf.php:0
    0.0020     111560   2. zf_main() /usr/share/phplib/ZendFramework-1.9.3PL1/bin/zf.php:23
    0.0220     686832   3. zf_run($zfConfig = array ('HOME' => '/home/jkendall')) /usr/share/phplib/ZendFramework-1.9.3PL1/bin/zf.php:36
    0.0221     686952   4. Zend_Tool_Framework_Client_Console::main($options = array ()) /usr/share/phplib/ZendFramework-1.9.3PL1/bin/zf.php:214
    0.0221     687440   5. Zend_Tool_Framework_Client_Abstract->dispatch() /usr/share/phplib/ZendFramework-1.9.3PL1/library/Zend/Tool/Framework/Client/Console.php:96
    0.0222     687560   6. Zend_Tool_Framework_Client_Abstract->initialize() /usr/share/phplib/ZendFramework-1.9.3PL1/library/Zend/Tool/Framework/Client/Abstract.php:209
    0.0296     866600   7. Zend_Tool_Framework_Loader_Abstract->load() /usr/share/phplib/ZendFramework-1.9.3PL1/library/Zend/Tool/Framework/Client/Abstract.php:118
    0.4100    2729736   8. include_once('/usr/share/php/PHPUnit/Framework/TestSuite/DataProvider.php') /usr/share/phplib/ZendFramework-1.9.3PL1/library/Zend/Tool/Framework/Loader/Abstract.php:90
 
jkendall@san-diego:~/dev/www$

As it turns out, this is a known bug in version 1.9.0+ of the Zend Framework.  See ZF-7894 in the ZF issue tracker for full details.  While this issue is not yet resolved in the tracker, Raphael Stolt has provided a workaround in the form of a diff file attached to the issue.  While your mileage may vary, the patch worked perfectly for me.  I’m able to go ahead and dive into unit testing my Zend Framework applications.

UPDATE: ZF-7894 was resolved during Bug Hunt days this week. Many thanks to Benjamin Eberlei!

Dell 1420n Ubuntu Wireless Issue Resolved

A few months ago I picked up a Dell 1420n loaded with Ubuntu 7.10. I’ve really enjoyed the laptop, but I’ve experienced ongoing issues with my wireless connectivity. The laptop will connect to my wireless router without any problems. Staying connected to the wireless router was the problem.

After using the laptop for anywhere from 5 minutes to 36 hours, the wireless connection would drop. The only way to reconnect was to reboot the laptop. That got old fast, but being a new Linux user I had no idea how to troubleshoot the issue. I finally Googled the problem and, via this thread on the excellent Ubuntu Forums, I found the DellLinuxWiki and the answer to my problem.

The issue has something to do with the ipw3945 wireless module. The DellLinuxWiki entry suggests using the network module iwl3945 instead, and provides simple step-by-step instructions as to how to disable the ipw3945 module and how to enable the iwl3945 module.

The resolution works like a charm, and I haven’t had a wireless connectivity issue since.

Zend Studio for Eclipse Leap Year FTP Bug

I found a bug in Zend Studio for Eclipse the other day. I created a new QA subdomain for one of my web project. When I tried to view the new directory in Zend Studio for Eclipse, it wouldn’t show up. Nothing that I did in Zend Studio would make it show up.

It drove me nuts until I found a clue in this discussion on the Zend Forums. Zend Forum member adlorenz posted the clue, saying

. . . it seems like bug concerns only files/directories that have leap day date of last modification . . .

Turns out that any directory or file created or last modified on Feb 29 of this year won’t show up in FTP Remote Systems connections in Zend Studio for Eclipse. I logged into my account, touched the directories and files that were dated Feb 29 ($ touch dirname), and I could finally see the directories and files in the Remote Systems Explorer.