Skip to content

Commit 0181e8e

Browse files
authored
Drop PHP 7.2 support and update phpunit (#966)
* Drop PHP 7.2 support and update phpunit * Update test matrix (PHP-Laravel versions) * Allow kylekatarnls/update-helper to fix CI Error: Error: kylekatarnls/update-helper contains a Composer plugin which is blocked by your allow-plugins config. You may add it to the list if you consider it safe. You can run "composer config --no-plugins allow-plugins.kylekatarnls/update-helper [true|false]" to enable it (true) or disable it explicitly and suppress this exception (false) See https://getcomposer.org/allow-plugins In PluginManager.php line 762: kylekatarnls/update-helper contains a Composer plugin which is blocked by y our allow-plugins config. You may add it to the list if you consider it saf e. You can run "composer config --no-plugins allow-plugins.kylekatarnls/update -helper [true|false]" to enable it (true) or disable it explicitly and supp ress this exception (false) See https://getcomposer.org/allow-plugins * Skip failing matrix element PHPUnit 9.0.0 by Sebastian Bergmann and contributors. Runtime: PHP 8.0.20 Configuration: /home/runner/work/telegram-bot-sdk/telegram-bot-sdk/phpunit.xml.dist Warning - The configuration file did not pass validation! The following problems have been detected: Line 14: - Element 'coverage': This element is not expected. Test results may not be as expected. PHP Fatal error: Type declaration 'mixed' must be unqualified in /home/runner/work/telegram-bot-sdk/telegram-bot-sdk/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php(49) : eval()'d code on line 323 ...................................................... Error: Process completed with exit code 255. * Update phpunit version
1 parent 55c2b7e commit 0181e8e

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: CI
22

33
on:
4+
workflow_dispatch:
45
push:
56
paths:
67
- 'src/**'
@@ -21,12 +22,14 @@ jobs:
2122
strategy:
2223
fail-fast: true
2324
matrix:
24-
php: ['7.2', '7.3', '7.4', '8.0']
25-
laravel: [5.5.*, 6.*, 7.*, '^8.0']
25+
php: ['7.3', '7.4', '8.0', '8.1', '8.2']
26+
laravel: [5.5.*, 6.*, 7.*, '^8.0', '^9.0']
2627
dependency-version: [prefer-lowest, prefer-stable]
2728
exclude:
28-
- php: '7.2'
29-
laravel: '^8.0'
29+
- laravel: '^9.0'
30+
php: '7.3'
31+
- laravel: '^9.0'
32+
php: '7.4'
3033

3134
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
3235
env:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ composer.phar
22
composer.lock
33
vendor/
44
build/
5+
.phpunit.result.cache
6+
.phpunit.cache

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.2 || ^8.0",
16+
"php": ">=7.3",
17+
"ext-json": "*",
1718
"guzzlehttp/guzzle": "^6.3 || ^7.0.1",
1819
"guzzlehttp/psr7": "^1.4 || ^2",
1920
"illuminate/support": "5.5 - 9",
2021
"league/event": "^2.1"
2122
},
2223
"require-dev": {
23-
"phpunit/phpunit": "^8.5 || ^9.0"
24+
"phpunit/phpunit": "^9.5"
2425
},
2526
"autoload": {
2627
"psr-4": {
@@ -54,7 +55,10 @@
5455
},
5556
"config": {
5657
"preferred-install": "dist",
57-
"sort-packages": true
58+
"sort-packages": true,
59+
"allow-plugins": {
60+
"kylekatarnls/update-helper": true
61+
}
5862
},
5963
"minimum-stability": "dev",
6064
"prefer-stable": true

phpunit.xml.dist

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
35
backupGlobals="false"
46
backupStaticAttributes="false"
57
colors="true"
68
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
9+
cacheResultFile=".phpunit.cache/test-results"
10+
executionOrder="depends,defects"
11+
forceCoversAnnotation="false"
12+
beStrictAboutCoversAnnotation="false"
13+
beStrictAboutOutputDuringTests="true"
14+
beStrictAboutTodoAnnotatedTests="true"
15+
convertDeprecationsToExceptions="true"
16+
failOnRisky="false"
17+
failOnWarning="false">
18+
<coverage
19+
cacheDirectory=".phpunit.cache/code-coverage"
20+
processUncoveredFiles="true">
21+
<include>
22+
<directory suffix=".php">src</directory>
23+
</include>
24+
</coverage>
1225
<testsuites>
13-
<testsuite name="Telegram Bot PHP SDK Test Suite">
14-
<directory suffix="Test.php">tests/</directory>
26+
<testsuite name="Telegram Bot SDK Test Suite">
27+
<directory suffix="Test.php">tests</directory>
1528
</testsuite>
1629
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
<exclude>
21-
<directory suffix=".php">src/Laravel/config/</directory>
22-
</exclude>
23-
</whitelist>
24-
</filter>
2530
</phpunit>

0 commit comments

Comments
 (0)