-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds a project-specific phpunit.xml file. #109
Open
jhedstrom
wants to merge
1
commit into
master
Choose a base branch
from
108-phpunit-xml
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- TODO set checkForUnintentionallyCoveredCode="true" once https://www.drupal.org/node/2626832 is resolved. --> | ||
<!-- PHPUnit expects functional tests to be run with either a privileged user | ||
or your current system user. See core/tests/README.md and | ||
https://www.drupal.org/node/2116263 for details. | ||
--> | ||
<phpunit bootstrap="build/html/core/tests/bootstrap.php" colors="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutChangesToGlobalState="true" | ||
checkForUnintentionallyCoveredCode="false"> | ||
<!-- TODO set printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter" once | ||
https://youtrack.jetbrains.com/issue/WI-24808 is resolved. Drupal provides a | ||
result printer that links to the html output results for functional tests. | ||
Unfortunately, this breaks the output of PHPStorm's PHPUnit runner. However, if | ||
using the command line you can add | ||
- -printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" to use it (note there | ||
should be no spaces between the hyphens). | ||
--> | ||
<php> | ||
<!-- Set error reporting to E_ALL. --> | ||
<ini name="error_reporting" value="32767"/> | ||
<!-- Do not limit the amount of memory tests take to run. --> | ||
<ini name="memory_limit" value="-1"/> | ||
<!-- Example SIMPLETEST_BASE_URL value: http://localhost --> | ||
<env name="SIMPLETEST_BASE_URL" value="http://project.vm"/> | ||
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix --> | ||
<env name="SIMPLETEST_DB" value=""/> | ||
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output --> | ||
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/tmp"/> | ||
</php> | ||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory>./src/modules/*/tests/src/Unit</directory> | ||
<exclude>./build/html/core</exclude> | ||
<exclude>./build/html/modules/contrib</exclude> | ||
<exclude>./vendor</exclude> | ||
</testsuite> | ||
<testsuite name="kernel"> | ||
<directory>./src/modules/*/tests/src/Kernel</directory> | ||
<exclude>./build/html/core</exclude> | ||
<exclude>./build/html/modules/contrib</exclude> | ||
<exclude>./vendor</exclude> | ||
</testsuite> | ||
<testsuite name="functional"> | ||
<directory>./src/modules/*/tests/src/Functional</directory> | ||
<exclude>./build/html/core</exclude> | ||
<exclude>./build/html/modules/contrib</exclude> | ||
<exclude>./vendor</exclude> | ||
</testsuite> | ||
<testsuite name="functional-javascript"> | ||
<directory>./src/modules/*/tests/src/FunctionalJavascript</directory> | ||
<exclude>./build/html/core</exclude> | ||
<exclude>./build/html/modules/contrib</exclude> | ||
<exclude>./vendor</exclude> | ||
</testsuite> | ||
</testsuites> | ||
<listeners> | ||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"> | ||
</listener> | ||
<listener class="\Drupal\Tests\Listeners\DrupalStandardsListener"> | ||
</listener> | ||
<listener class="\Drupal\Tests\Listeners\DrupalComponentTestListener"> | ||
</listener> | ||
</listeners> | ||
<!-- Filter for coverage reports only on custom code. This intentionally excludes core and contrib files. --> | ||
<filter> | ||
<whitelist> | ||
<directory>./src/modules</directory> | ||
<!-- By definition test classes have no tests. --> | ||
<exclude> | ||
<directory suffix="Test.php">./</directory> | ||
<directory suffix="TestBase.php">./</directory> | ||
<!-- Exclude core and contrib code from test coverage. --> | ||
<directory>./build/html/modules/contrib</directory> | ||
<directory>./build/html/core</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment variables override these, so if we were to set those in one of the rig generators, that would work. This would still be nice to have set, but could be an
@todo
for the time being. Having this file in the project root would at least make configuration of testing clearer for devs I think.