Skip to content

Commit a19c7ea

Browse files
committed
tests: change phpunit config and bootstrap file.
1 parent 80de85f commit a19c7ea

File tree

2 files changed

+25
-42
lines changed

2 files changed

+25
-42
lines changed

phpunit-bootstrap.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
if (\defined('PHP_CODESNIFFER_IN_TESTS') === false) {
4+
\define('PHP_CODESNIFFER_IN_TESTS', true);
5+
}
6+
37
/*
48
* Load the necessary PHPCS files.
59
*/
@@ -25,7 +29,7 @@
2529
&& \file_exists($phpcsDir . '/tests/bootstrap.php')
2630
) {
2731
require_once $phpcsDir . '/autoload.php';
28-
require_once $phpcsDir . '/tests/bootstrap.php'; // PHPUnit 6.x+ support.
32+
require_once $phpcsDir . '/tests/bootstrap.php';
2933
} else {
3034
echo 'Uh oh... can\'t find PHPCS.
3135

phpunit.xml

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
55
backupGlobals="true"
6-
beStrictAboutOutputDuringTests="true"
7-
beStrictAboutTestsThatDoNotTestAnything="false"
86
bootstrap="./phpunit-bootstrap.php"
9-
cacheDirectory=".phpunit.cache"
10-
displayDetailsOnTestsThatTriggerErrors="true"
11-
displayDetailsOnTestsThatTriggerWarnings="false"
12-
displayDetailsOnTestsThatTriggerNotices="true"
13-
displayDetailsOnTestsThatTriggerDeprecations="true"
14-
displayDetailsOnPhpunitDeprecations="false"
15-
failOnWarning="false"
16-
failOnNotice="true"
17-
failOnDeprecation="true"
18-
failOnPhpunitDeprecation="false"
19-
>
7+
beStrictAboutTestsThatDoNotTestAnything="false"
8+
convertErrorsToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertDeprecationsToExceptions="true"
12+
colors="true"
13+
forceCoversAnnotation="true">
14+
2015
<testsuites>
21-
<testsuite name="yCodeTech_Sniffs">
22-
<directory>./yCodeTech/Tests/</directory>
16+
<testsuite name="yCodeTech">
17+
<directory suffix="UnitTest.php">./yCodeTech/Tests/</directory>
2318
</testsuite>
2419
</testsuites>
2520

26-
<groups>
27-
<exclude>
28-
<group>CBF</group>
29-
</exclude>
30-
</groups>
31-
32-
<source>
33-
<include>
34-
<directory suffix=".php">./yCodeTech/</directory>
35-
</include>
36-
<exclude>
37-
<directory suffix="UnitTest.php">./yCodeTech/Tests/</directory>
38-
</exclude>
39-
</source>
40-
41-
<coverage includeUncoveredFiles="true">
42-
<report>
43-
<clover outputFile="build/logs/clover.xml"/>
44-
<text outputFile="php://stdout" showOnlySummary="true"/>
45-
</report>
46-
</coverage>
21+
<filter>
22+
<whitelist addUncoveredFilesFromWhitelist="true">
23+
<directory suffix=".php">./yCodeTech/Sniffs/</directory>
24+
</whitelist>
25+
</filter>
4726

48-
<php>
49-
<env name="PHP_CODESNIFFER_CBF" value="0"/>
50-
</php>
51-
</phpunit>
27+
<logging>
28+
<log type="coverage-clover" target="build/logs/clover.xml"/>
29+
</logging>
30+
</phpunit>

0 commit comments

Comments
 (0)