You can use php linting on continuousphp by simply enabling it in your Pipelines. Simply go to the Testing Settings (step 2 of the pipeline configuration) and choose PHP lint from the available Testing tools. You can specify Phing targets or Shell scripts to run before the tests. As for all other Testing Tools on continuousphp, you can choose if the tests with will block the deployment on failure or if the build goes into a warning state if the tests fail.
You can use wildcards or entire folders to configure PHP lint, e.g.
src/*, if you want to match multiple files at once. Folders will be parsed recursively.
You don't need to run
php -l using a shell command or a Phing target. continuousphp takes care of starting the tests for you.
You can specify tasks to be executed before running the tests. This can be very useful to initialize external resources like databases or third-party services. Currently continuousphp supports Phing, but others will be supported soon (shell commands, ...).
Tasks can be defined at different places in your workflow:
During the creation of the package to be tested
During the tests
During the creation of the package to be deployed
As soon as the testing package is created, the tests will start:
And that's it! You just configured your application to be tested with PHP lint!
You can use Environment Variables to configure your testing environment. Simply go to the Test Settings (step 2 of the pipeline configuration), open the PHP lint configuration and add one or more Environment Variables:
Environment Variables can (optionally) be encrypted. Pay attention that, once a variable is encrypted, you can no longer obtain it's value. An encrypted Environment Variable can only be decrypted during a build by continuousphp's workers. Encrypted Environment Variables will be masked in the build output.