Testing¶
Testing-Environment¶
To run our test tools, the first thing we need to do is to create a development environment with all the dependencies.
Run composer install inside the higher education package folder to have all dependencies in .Build
directory.
This is how the development environment is installed from the command line:
$ cd /var/www/html/vendor/t3g/higher-education-package/
$ composer install
PHPUnit¶
We use the TYPO3 core testing framework (based on phpunit) for the unit tests. The aim of the testing framework is to provide a good way to write and run unit test specially for TYPO3. The higher education package provides a configuration file on it´s root folder. This is how the unit tests are executed from the command line:
$ cd /var/www/html/vendor/t3g/higher-education-package/
$ .Build/vendor/bin/phpunit -c phpunit.xml --testdox
PHPStan¶
PHPStan scans your whole codebase and looks for obvious bugs. The higher education package provides a configuration file on it´s root folder. This is how phpstan is executed from the command line:
$ cd /var/www/html/vendor/t3g/higher-education-package/
$ .Build/vendor/bin/phpstan analyze
Rector¶
Rector is a PHP tool that you can run on any PHP project to get an instant upgrade or automated refactoring. It helps with PHP upgrades, framework upgrades and improves your code quality. The higher education package provides a configuration file on it´s root folder. This is how rector is executed from the command line:
$ cd /var/www/html/vendor/t3g/higher-education-package/
$ .Build/vendor/bin/rector process . --dry-run