In order to run Imagine tests, enter the root directory of Imagine (the one that contains composer.json
) and execute the following command:
composer install
composer test
Imagine uses phpunit to perform the tests.
You can pass options to phpunit by adding them after a --
:
composer test -- --filter=DrawerTest
please remark that the --
have to be specified just once, even if you pass more options to phpunit:
composer test -- --filter=DrawerTest --colors=never
Imagine tests may be part of one or more groups. Currently defined groups are:
always-skipped
these tests will always be marked as skippedgd
tests that require the GD php extensiongmagick
tests that require the Gmagick php extensionimagick
tests that require the Imagick php extension
For example, you can skip the tests that will always be skipped and the tests that require Gmagick by running:
composer test -- --exclude-group=always-skipped,gmagick
Imagine tests often save temporary files to the tests/tmp
folder.
These files are deleted once test completes.
In order to see what's actually gets generated by tests, you can set the IMAGINE_TEST_KEEP_TEMPFILES
environment directory to a non falsy value.
For example, with POSIX systems you can run:
IMAGINE_TEST_KEEP_TEMPFILES=1 composer test
or
export IMAGINE_TEST_KEEP_TEMPFILES=1
composer test
With Windows systems you can run:
set IMAGINE_TEST_KEEP_TEMPFILES=1
composer test