Skip to content

Commit 63d8ab3

Browse files
committed
Resolve #1
2 parents b0db335 + 5655c3f commit 63d8ab3

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88

99
strategy:
10-
php:
11-
versions: [7.0, 7.1, 7.2, 7.3, 7.4, 8.0]
10+
matrix:
11+
php: [7.0, 7.1, 7.2, 7.3, 7.4, 8.0]
1212

1313
steps:
1414
- name: Checkout code
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: ${{ php.versions }}
20+
php-version: ${{ matrix.php }}
2121
coverage: none
2222

2323
- name: Validate composer.json and composer.lock

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"psr/http-client": "^1.0"
1717
},
1818
"require-dev": {
19-
"nyholm/psr7": "^1.3",
20-
"phpunit/phpunit": "^6.5",
19+
"guzzlehttp/psr7": "^1.7",
20+
"phpunit/phpunit": ">=6.5",
2121
"squizlabs/php_codesniffer": "^3.5",
2222
"webclient/fake-http-client": "^1.0"
2323
},

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php" colors="true">
2+
<phpunit bootstrap="vendor/autoload.php" colors="true" cacheResult="false">
33
<testsuites>
44
<testsuite name="all">
55
<directory>tests</directory>

stuff/Handler.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Stuff\Webclient\Extension\Redirect;
66

7-
use Nyholm\Psr7\Response;
7+
use GuzzleHttp\Psr7\Response;
88
use Psr\Http\Message\ResponseInterface;
99
use Psr\Http\Message\ServerRequestInterface;
1010
use Psr\Http\Server\RequestHandlerInterface;
@@ -40,6 +40,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface
4040
$headers['Location'] = $request->getUri()->withQuery($get)->__toString();
4141
$status = 302;
4242
}
43-
return new Response($status, $headers, (string)$visit, '1.1');
43+
return new Response($status, $headers, (string)$visit);
4444
}
4545
}

tests/RedirectClientTest.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace Tests\Webclient\Extension\Redirect;
66

7+
use GuzzleHttp\Psr7\Request;
78
use Stuff\Webclient\Extension\Redirect\Handler;
8-
use Nyholm\Psr7\Request;
99
use PHPUnit\Framework\TestCase;
1010
use Psr\Http\Client\ClientExceptionInterface;
1111
use Webclient\Extension\Redirect\Client;
@@ -28,10 +28,9 @@ public function testRedirects(int $maxRedirects, int $needRedirects, int $expect
2828

2929
$client = new Client(new FakeClient(new Handler()), $maxRedirects);
3030

31-
$request = new Request('GET', 'http://localhost?redirects=' . $needRedirects, ['Accept' => 'text/plain']);
31+
$request = new Request('GET', 'http://localhost/?redirects=' . $needRedirects, ['Accept' => 'text/plain']);
3232

3333
$response = $client->sendRequest($request);
34-
3534
$this->assertSame($expectRedirects, (int)$response->getBody()->__toString());
3635
}
3736

0 commit comments

Comments
 (0)