News Robot

Zendcon 2012 CfP Advisory Panel

Just by way of thanks, I would like to present to you panelists for the ZendCon 2012 Call for Papers advisory panel.  They will be assisting me in determining which submissions get turned into sessions. Please thank them for the hell I will put them through. Maurice Kherlakian (mkherlakian) – Damn good Zend consultant, but [...]
Author: Kevin Schroeder
Source: ESchrade

by News Robot on May 1, 2012 in News, No Comments »
tags: , , ,

Unit testing Zend Framework 1

As part of our release process for Zend Framework 1.12, I’ve been working through the unit tests and running them on PHP 5.2.4 as it seems that recent changes weren’t being tested with that version. This isn’t totally surprising as Open Source contributors are, almost by definition, interested in new things and so are much more likely to be running PHP 5.4 rather than 5.2! This is, of course, a compelling reason for using continuous integration and I’m quite excited with Travis-CI and we are using it with ZF2.

Installing PHPUnit 3.4

The first challenge that I encountered was that ZF1′s unit test are not compatible with PHPUnit 3.6. As there are over 14,000 ZF1 unit tests which have been written since 2006, there hasn’t been much enthusiasm for rewriting them to be PHPUnit 3.6 compatible. (However, if someone wants to volunteer, please contact me!)

As I have PHPUnit 3.6 installed for testing other projects, I needed to install PHPUnit 3.4 side-by-side with version 3.6 This turns out to be relatively easy and has been documented by Christer Edvartsen in his article Running Multiple Versions of PHPUnit.

I ran into one problem with his instructions though and needed this code to be added to the top of phpunit:

set_include_path(implode(PATH_SEPARATOR, array(
    __DIR__ '/../share/php',
    '/usr/share/php',
    get_include_path()
)));

Having done this though, PHPUnit 3.4 works correctly and we can run ZF1 unit tests.

Running the ZF1 unit tests

To run ZF1′s unit tests, you first need to check out the code from the Subversion repository.

svn co http://framework.zend.com/svn/framework/standard/trunk/

Due to the number of tests and the memory that they take up, you should run tests for each component individually.

The command to use is:

phpunit34 --stderr -d memory_limit=-1 Zend/{Component}/AllTests.php

Note:

  • --stderr pipes PHPUnit’s output to stderr which means that any tests that rely on header() will work. (i,e. don’t test Zend_Session without it!)
  • -d memory_limit=-1 will turn off PHP’s memory_limit setting. The ZF1 unit tests use a lot of memory, so this is easiest.
  • The tests rely on being set up correctly. This is done using AllTests.php so don’t forget this. Tests will fail if you forget!

All that needs to happen now is that any failing tests are fixed!

flattr this!

Author: Rob…

by News Robot on May 1, 2012 in News, No Comments »
tags: , , ,

Google Drive

I posted on Twitter a link to an article on CNet about the terms of service for Google Drive.  There was a hubbub about this part of the ToS. “Your Content in our Services: When you upload or otherwise submit content to our Services, you give Google (and those we work with) a worldwide licence to [...]
Author: Kevin Schroeder
Source: ESchrade

by News Robot on April 30, 2012 in News, No Comments »
tags: ,

ZF2 Dependency Injection – Multiple Object Instances

When you work with the ZF2 Dependency Injection Container (DiC) when you make multiple requests for an instance of an object you will get the same object back each time. For example, with this code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [...]
Author: Kevin Schroeder
Source: ESchrade

PHP|Tek 2012 Conference

Join Ralph Schindler, Zend Framework Project Developer, and Kevin Schroeder, Zend Technology Evangelist, at PHP|Tek and learn more about Zend Framework 2 and phpcloud.com.
Author:
Source: Zend Events

by News Robot on April 28, 2012 in News, No Comments »
tags: , ,