Skip to content

Bootstrap scripts specific to test suites #3795

@sebastianbergmann

Description

@sebastianbergmann

It should be possible to have <testsuite> specific bootstrap scripts:

<?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.2/phpunit.xsd" bootstrap="vendor/autoload.php"> <testsuites> <testsuite name="unit"> <directory suffix="Test.php">tests/unit</directory> </testsuite> <testsuite name="integration" bootstrap="tests/integration/bootstrap.php"> <directory suffix="Test.php">tests/integration</directory> </testsuite> </testsuites> </phpunit>

phpunit should load vendor/autoload.php and tests/integration/bootstrap.php.

phpunit --testsuite unit should only load vendor/autoload.php.

phpunit --testsuite integration should load vendor/autoload.php and tests/integration/bootstrap.php.

Each bootstrap script, even if configured multiple times, must only be loaded once.

Metadata

Metadata

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions