| /dev/null
Blog: PHP, Python, Linux, Web services & Continuous delivery

Tag: ZendFramework

To generate a skeleton unit test when using a framework with autoloading you need to provide the bootstrap file or phpunit will not be able to find any parent classes.

phpunit-skelgen --bootstrap path/to/bootstrap/Bootstrap.php --test -- "namespace\qualified\Classname" Classname

The above assumes that you are running the command from within the directory that contains the class.

Read more

I started writing a plug-in for SublimeText 2 to speed up the development of Zend Framework 2 (ZF2) applications called ZF2Helper. So far I've implemented a couple of features and I intend to add more as and when I come across a ZF2 task that would benefit from some automation. Below is a quick example of using ZF2Helper to create new ZF2 modules and new controller actions. The full source is available on github: https://github.com/pipe-devnull/ZF2Helper and the package can be installed in Sublime Text 2 using package_control.

Creating ZF2 Modules with ZF2Helper

Create an entirely new ZF2 module with 1 click rather than copying, pasting, renaming all files individually. Much quicker :)

This option is only available in the side bar context menu.

  1. In the side bar, navigate through to the root of the ZF2 modules directory
  2. Right click on the modules folder and select "ZF2Helper > New ZF2 Module"
  3. Input the name of the new module into the prompt
  4. Add the name of the module into the main ZF2 Application configuration file (ApplicationRoot / config / application.config.php)
Read more