Skip to content

Commit ab9b8de

Browse files
committed
composer: add PHP ^8.0 support
1 parent af00358 commit ab9b8de

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php: [ 7.3, 7.4 ]
18+
php: [ 7.3, 7.4, 8.0 ]
1919
laravel: [ '^6.10', '^7.0', '^8.0' ]
2020
dependency-version: [prefer-lowest, prefer-stable]
2121

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^7.3",
17+
"php": "^7.3 || ^8.0",
1818
"illuminate/support": "^6.10 || ^7.0 || ^8.0",
1919
"illuminate/http": "^6.10 || ^7.0 || ^8.0"
2020
},

tests/Response/PercentageJsonResponseTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3-
namespace CodingSocks\UploadHandler\Response;
3+
namespace CodingSocks\UploadHandler\Tests\Response;
44

5+
use CodingSocks\UploadHandler\Response\PercentageJsonResponse;
56
use Illuminate\Foundation\Testing\Concerns\MakesHttpRequests;
6-
use Illuminate\Http\Response;
7+
use Illuminate\Testing\TestResponse;
78
use PHPUnit\Framework\TestCase;
9+
use Symfony\Component\HttpFoundation\Response;
810

911
class PercentageJsonResponseTest extends TestCase
1012
{
@@ -28,7 +30,11 @@ public function percentageProvider()
2830
*/
2931
public function testContent(int $percentage, array $expectedContent)
3032
{
31-
$response = $this->createTestResponse(new PercentageJsonResponse($percentage));
33+
if (class_exists('\Illuminate\Testing\TestResponse')) {
34+
$response = TestResponse::fromBaseResponse(new PercentageJsonResponse($percentage));
35+
} else {
36+
$response = $this->createTestResponse(new PercentageJsonResponse($percentage));
37+
}
3238

3339
$response->assertSuccessful();
3440
$response->assertStatus(Response::HTTP_OK);

0 commit comments

Comments
 (0)