Skip to content

Commit fd02b1f

Browse files
Add support for PHP 8.* in unit tests
1 parent f6ad4fd commit fd02b1f

File tree

4 files changed

+22
-25
lines changed

4 files changed

+22
-25
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: php
22
php:
3+
- '8.1'
4+
- '8.0'
35
- '7.4'
46
- '7.3'
57
- '7.2'
@@ -11,7 +13,7 @@ before_install:
1113
- export COMPOSER_MEMORY_LIMIT=-1
1214
install: composer install
1315

14-
script: vendor/bin/phpunit
16+
script: vendor/bin/simple-phpunit
1517

1618
branches:
1719
except:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"ext-json": "*"
2929
},
3030
"require-dev": {
31-
"phpunit/phpunit": "^5",
31+
"symfony/phpunit-bridge": "^5.2",
3232
"phpmd/phpmd": "*",
3333
"squizlabs/php_codesniffer": "3.*",
3434
"friendsofphp/php-cs-fixer": "*",

phpunit.xml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
4-
<phpunit
5-
backupGlobals = "false"
6-
backupStaticAttributes = "false"
7-
colors = "true"
8-
convertErrorsToExceptions = "true"
9-
convertNoticesToExceptions = "true"
10-
convertWarningsToExceptions = "true"
11-
processIsolation = "false"
12-
stopOnFailure = "false"
13-
syntaxCheck = "false"
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
5+
backupGlobals="false"
6+
backupStaticAttributes="false"
7+
colors="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
11+
processIsolation="false"
12+
stopOnFailure="false"
13+
bootstrap="vendor/autoload.php"
1414
>
15-
15+
<php>
16+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
17+
<env name="SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT" value="1"/>
18+
</php>
1619
<testsuites>
1720
<testsuite name="Unit">
1821
<directory>tests/Unit</directory>
1922
</testsuite>
20-
<testsuite name="Integration">
21-
<directory>tests/Integration</directory>
22-
</testsuite>
2323
</testsuites>
2424

2525
<filter>
26-
<blacklist>
27-
<directory suffix=".php">./vendor</directory>
28-
</blacklist>
2926
<whitelist processUncoveredFilesFromWhitelist="true">
3027
<directory suffix=".php">./src</directory>
3128
</whitelist>
3229
</filter>
33-
3430
</phpunit>

tests/Unit/Transformation/Image/ResizeTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,11 @@ public function testScale()
108108
);
109109
}
110110

111-
/**
112-
* @expectedException InvalidArgumentException
113-
* @expectedExceptionMessage Liquid Rescaling is not supported for
114-
*/
115111
public function testLiquidForUnsupportedCropMode()
116112
{
113+
$this->expectException(InvalidArgumentException::class);
114+
$this->expectExceptionMessage('Liquid Rescaling is not supported for');
115+
117116
Scale::limitFit(100, 200)->liquidRescaling();
118117
}
119118

0 commit comments

Comments
 (0)