Docker tools to easily create and run tests for the PHP-SRC. The intent of this library is to help any PHP developer to help PHP core developers by creating PHPT tests for the language engine and its core extensions.
All you need to start using it is cloning the repository and have docker installed on your machine.
- Write a PHPT test and add it to the
phpt
folder; - Run the
./phpqa
command passing as arguments the filename and the PHP version to run the test (71, 70, 56, 55):
# without a version the test will run agains PHP 7.1 codebase
./phpqa phpt/examples/closure_061.phpt
# with a version the test will run against the specified version
./phpqa phpt/examples/closure_061.phpt 56
# if you want you can pass `all` as second argument and the test will run against all versions
./phpqa phpt/examples/closure_061.phpt all
Note that when running the test suit there will be an output message reminding you to run make test
. THis is a standard message and you don't need to run it.
Build complete.
Don't forget to run 'make test'.
- PHP 5.5, 5.6, 7.0 and 7.1 are fully available and supported;
- PHP 7.2 is about to work but since 7.2.0alpha2 is unable to be built we are still waiting the related PEAR bug to be fixed.
If you notice any bug or typo, please feel free to create an issue and/or open a pull request with the fix.
This repository intent to facilitate participation and contribution in the PHP Test Festival. More information about it:
- QA PHP TestFest
- Some blog posts from Stefan Koopmanschap
- Philip Norton's post on the UK PHP TestFest 2010
- PHPBelgium slides for preparing for TestFest 2009
- PHPTestFestBrasil
- Sammy's php|tek 2017 talk
- Discussion at PHP User Groups list
- Testing with .php files on PHP Internals Book
Add more PHP versions (PHP 7.2alpha and PHP 5.5 at least) Issue #5;- Put some effort to shrink the images, either using the Alpine version of them or any other strategy Issue #6;
- Integrate this repository with CircleCi in order to have the docker images builds tested Issue #7;
- Improve documentation, adding a session about how to write PHPT Issue #8;
- The tests in the examples folder are part of the PHP interpreter codebase distributed under PHP License 3.01.
- The Dockerfile in this repository is inspired and based on the official Dockerfile template and images present in the
PHP Docker Hub repository also available at the Docker Library Github repository. The
scripts
docker-php-*
are also from the same repository. These source code is distributed under MIT license.
Copyright (c) 2017 Bruno Ricardo Siqueira, Joao Paulo Vendramini Martins
This work is licensed under the terms of the MIT license.