Skip to content

Commit 6ae3623

Browse files
committed
Drop PHP 8.0 support
1 parent 0da0f5e commit 6ae3623

7 files changed

+30
-17
lines changed

.circleci/config.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
working_directory: ~/testmonitor/slack-client
66

77
docker:
8-
- image: cimg/php:8.0
8+
- image: cimg/php:8.1
99

1010
steps:
1111
- run:
@@ -24,7 +24,7 @@ jobs:
2424
working_directory: ~/testmonitor/slack-client
2525

2626
docker:
27-
- image: cimg/php:8.0
27+
- image: cimg/php:8.1
2828

2929
steps:
3030
- attach_workspace:
@@ -53,16 +53,22 @@ jobs:
5353
working_directory: ~/testmonitor/slack-client
5454

5555
docker:
56-
- image: cimg/php:8.0
56+
- image: cimg/php:8.1
5757

5858
steps:
5959
- attach_workspace:
6060
at: .
61+
- run:
62+
name: Install PCOV
63+
command: |
64+
sudo apt-get update
65+
sudo apt install php-common
66+
sudo pecl install pcov
6167
- run:
6268
name: Run Unit Tests
6369
command: |
6470
mkdir -p ./logs/phpunit
65-
vendor/bin/phpunit -d memory_limit=1G --printer "\PHPUnit\TextUI\DefaultResultPrinter" --log-junit logs/phpunit/junit.xml --testdox-html logs/phpunit/testdox.html
71+
vendor/bin/phpunit -d memory_limit=1G --log-junit logs/phpunit/junit.xml --testdox-html logs/phpunit/testdox.html
6672
6773
- store_artifacts:
6874
path: ./logs/phpunit

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Thumbs.db
88

99
phpunit.xml
1010
.phpunit.result.cache
11+
.phpunit.cache
1112
/build
13+
/logs
1214

1315
/.idea
1416

.scrutinizer.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
build:
2+
environment:
3+
php:
4+
version: 8.1
25
nodes:
36
analysis:
47
tests:

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: php
22

33
php:
4-
- 8.0
4+
- 8.1
55

66
# This triggers builds to run on the new TravisCI infrastructure.
77
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
],
3232
"minimum-stability": "stable",
3333
"require": {
34-
"php": "^8.0",
34+
"php": "^8.1",
3535
"guzzlehttp/guzzle": "^7.3",
3636
"league/oauth2-client": "^2.6",
3737
"slack-php/slack-block-kit": "^0.19.0"
3838
},
3939
"require-dev": {
4040
"friendsofphp/php-cs-fixer": "^3.0",
4141
"mockery/mockery": "^1.4",
42-
"phpunit/phpunit": "^9.5",
43-
"scrutinizer/ocular": "^1.8",
44-
"squizlabs/php_codesniffer": "^3.5.2"
42+
"phpunit/phpunit": "^10.0",
43+
"scrutinizer/ocular": "^1.9",
44+
"squizlabs/php_codesniffer": "^3.7"
4545
},
4646
"config": {
4747
"optimize-autoloader": true,

phpunit.xml.dist

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" displayDetailsOnTestsThatTriggerDeprecations="true" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
33
<coverage>
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
74
<report>
85
<clover outputFile="build/logs/clover.xml"/>
96
<html outputDirectory="build/coverage"/>
@@ -18,4 +15,9 @@
1815
<logging>
1916
<junit outputFile="build/report.junit.xml"/>
2017
</logging>
18+
<source>
19+
<include>
20+
<directory suffix=".php">src/</directory>
21+
</include>
22+
</source>
2123
</phpunit>

tests/MessagesTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function it_can_post_a_message()
4141

4242
$service->shouldReceive('request')->once()->andReturn($response = Mockery::mock('Psr\Http\Message\ResponseInterface'));
4343
$response->shouldReceive('getStatusCode')->andReturn(200);
44-
$response->shouldReceive('getBody')->andReturn('ok');
44+
$response->shouldReceive('getBody')->andReturn(\GuzzleHttp\Psr7\Utils::streamFor('ok'));
4545

4646
$message = Kit::newMessage()->text('Hello');
4747

@@ -62,7 +62,7 @@ public function it_should_throw_an_unauthorized_exception_when_client_lacks_auth
6262

6363
$service->shouldReceive('request')->once()->andReturn($response = Mockery::mock('Psr\Http\Message\ResponseInterface'));
6464
$response->shouldReceive('getStatusCode')->andReturn(403);
65-
$response->shouldReceive('getBody')->andReturn('');
65+
$response->shouldReceive('getBody')->andReturn(\GuzzleHttp\Psr7\Utils::streamFor(''));
6666

6767
$this->expectException(UnauthorizedException::class);
6868

@@ -101,7 +101,7 @@ public function it_should_throw_a_validation_exception_when_client_sends_a_incom
101101

102102
$service->shouldReceive('request')->once()->andReturn($response = Mockery::mock('Psr\Http\Message\ResponseInterface'));
103103
$response->shouldReceive('getStatusCode')->andReturn(422);
104-
$response->shouldReceive('getBody')->andReturn(json_encode(['foo' => 'bar']));
104+
$response->shouldReceive('getBody')->andReturn(\GuzzleHttp\Psr7\Utils::streamFor(json_encode(['foo' => 'bar'])));
105105

106106
$this->expectException(ValidationException::class);
107107

@@ -121,7 +121,7 @@ public function it_should_throw_a_failed_action_exception_when_client_sends_a_ba
121121

122122
$service->shouldReceive('request')->once()->andReturn($response = Mockery::mock('Psr\Http\Message\ResponseInterface'));
123123
$response->shouldReceive('getStatusCode')->andReturn(400);
124-
$response->shouldReceive('getBody')->andReturn('');
124+
$response->shouldReceive('getBody')->andReturn(\GuzzleHttp\Psr7\Utils::streamFor(''));
125125

126126
$this->expectException(FailedActionException::class);
127127

0 commit comments

Comments
 (0)