https://github.com/peterrehm/php-test
CI helper scripts and configuration for PHP projects
https://github.com/peterrehm/php-test
behat ci jenkins phing phpunit
Last synced: 16 days ago
JSON representation
CI helper scripts and configuration for PHP projects
- Host: GitHub
- URL: https://github.com/peterrehm/php-test
- Owner: peterrehm
- Created: 2017-02-06T08:31:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-03T21:18:08.000Z (almost 7 years ago)
- Last Synced: 2025-10-03T05:35:33.434Z (4 months ago)
- Topics: behat, ci, jenkins, phing, phpunit
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
php-test
========
This library aims to ease the test setup of standard PHP projects using PHPUnit
and Behat using a phing build file.
Setup
-----
- Include this library using composer
````php
composer require peterrehm/php-test --dev
````
- Copy the sample build file into your project root
````sh
(project-root) $ cp vendor/peterrehm/php-test/build_local.xml build.xml
````
- Set up the test scripts
Create bin/run_tests.sh and bin/run_static_analysis.sh. The simplest version would
be as follows:
````sh
# bin/run_static_analysis.sh
#!/bin/bash
vendor/peterrehm/php-test/bin/run_static_analysis.sh
# bin/run_tests.sh
#!/bin/bash
vendor/peterrehm/php-test/bin/run_tests.sh coverage no-behat
````
Of course you could just copy from those files and add whatever logic you need
to it. As it is common to need custom test preparations you can pass a third
parameter to run tests with a custom script name.
If no script is provided a simple composer install will be executed. If you
provide a custom script make sure to manually run the composer install.
````
# bin/run_tests.sh
#!/bin/bash
vendor/peterrehm/php-test/bin/run_tests.sh coverage no-behat /my/custom/script.sh
````
This command will be executed prior to the test execution.