Subscribe to PHP Freaks RSS

Quick and easy PHP code generation testing

syndicated from planet-php.net on June 22, 2018

Quick and easy PHP code generation testing

Recently I was working on some PHP code (for the PHP-FIG) that involved code generation. Lots of systems these days are doing code generation (compiled dependency injection containers, ORM classes, etc.), but surprisingly I've avoided having to touch that code myself until now.

Of course, like any good developer I was writing tests for it as I went. That meant needing to test that the generated code was valid PHP syntax and did what I wanted it to do.

Larry 22 June 2018 - 9:40pm