A generator for Yeoman to generate boilerplate for a PHP library with support for PHPUnit
npm install generator-php-libraryA generator for Yeoman to generate boilerplate for a PHP library with support for PHPUnit.
npm install -g yonpm install -g generator-php-libraryyo php-library- creates correctly namespaced folder structure for your library:
- /src folder structure for your PHP code
- /tests folder structure for your PHPUnit unit tests
- installs and configures PHPUnit:
- installs PHPUnit using composer
- creates a phpunit.xml and Bootstrap.php file for PHPUnit
- creates GruntJS configuration for running PHPUnit using GruntJS
- creates a sample unit test file SampleTest.php
- creates configuration files:
- composer.json with autoloader support for your library
- package.json with the right dependencies to lint and unit test your code
- Gruntfile.js with the configuration to lint and unit test your code
- generates an autoloader for your library using composer
Add your library classes in the namespaced directories in the /src directory.
Add your unit tests in the namespaced directories in the /tests directory.
Run grunt to lint your PHP code and run your unit tests:
grunt
- First public release
- Added GruntJS support for linting PHP using the grunt-phplint plugin
- Added GruntJS support for unit testing using the grunt-phpunit plugin
- Added GruntJS support for PHP Code Sniffer using the grunt-phpcs plugin
- Added basic .gitignore
- Spoecial thanks to @melindrea for providing the idea to include GruntJS support