Skip to content

Files

Latest commit

a045f87 · Oct 18, 2021

History

History
This branch is 52 commits behind php-imagine/Imagine:develop.

tests

Running Imagine tests

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.

Passing arguments to phpunit

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

Filtering tests by group

Imagine tests may be part of one or more groups. Currently defined groups are:

  • always-skipped these tests will always be marked as skipped
  • gd tests that require the GD php extension
  • gmagick tests that require the Gmagick php extension
  • imagick 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

Test temporary files

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