Skip to content

Commit

Permalink
Update PHPUnit to version 9
Browse files Browse the repository at this point in the history
In order to prepare PHP8 compatibility we should use the recent version of PHPUnit
  • Loading branch information
Sven Hagemann committed Dec 16, 2020
1 parent 3108ccd commit 4fe069f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"kub-at/php-simple-html-dom-parser": "^1.7"
},
"require-dev": {
"phpunit/phpunit": "~5.0",
"phpunit/phpunit": "~9.0",
"doctrine/cache": "~1.0"
},
"suggest": {
Expand Down
48 changes: 19 additions & 29 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false"
colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true"
convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"
bootstrap="./tests/Caxy/Tests/TestInit.php"
>

<groups>
<exclude>
<group>performance</group>
</exclude>
</groups>

<testsuites>
<testsuite name="php-htmldiff Test Suite">
<directory>./tests/Caxy/Tests/HtmlDiff</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./lib</directory>
</whitelist>
</filter>

xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./lib</directory>
</include>
</coverage>
<groups>
<exclude>
<group>performance</group>
</exclude>
</groups>
<testsuites>
<testsuite name="php-htmldiff Test Suite">
<directory>./tests/Caxy/Tests/HtmlDiff</directory>
</testsuite>
</testsuites>
</phpunit>
6 changes: 4 additions & 2 deletions tests/Caxy/Tests/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Caxy\Tests;

abstract class AbstractTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

abstract class AbstractTest extends TestCase
{
protected function stripExtraWhitespaceAndNewLines($text)
{
Expand All @@ -14,4 +16,4 @@ protected function stripExtraWhitespaceAndNewLines($text)
)
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HTMLPurifierConfigTest extends AbstractTest
*/
protected $config;

public function setUp()
public function setUp() : void
{
$config = \HTMLPurifier_Config::createDefault();

Expand Down Expand Up @@ -73,4 +73,4 @@ public function testHtmlDiffConfigStatic()
$diff->setHTMLPurifierConfig($this->config);
$diff->build();
}
}
}

0 comments on commit 4fe069f

Please sign in to comment.