Skip to content

Commit d04adf8

Browse files
committed
Use Guzzle 7 in tests
1 parent c061c18 commit d04adf8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"require-dev": {
3232
"friendsofphp/php-cs-fixer": "^2.17",
33-
"php-http/guzzle6-adapter": "^2.0",
33+
"guzzlehttp/guzzle": "^7.3",
3434
"phpunit/phpunit": "^7.0|^8.0"
3535
},
3636
"provide": {

tests/ResponseBuilderTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Swis\Http\Fixture\Tests;
44

5-
use function GuzzleHttp\Psr7\stream_for;
5+
use GuzzleHttp\Psr7\Utils;
66
use Http\Discovery\MessageFactoryDiscovery;
77
use PHPUnit\Framework\TestCase;
88
use Swis\Http\Fixture\MockNotFoundException;
@@ -29,7 +29,7 @@ public function itCanBuildAResponse(string $url, string $method, string $expecte
2929
200,
3030
null,
3131
[],
32-
stream_for(file_get_contents($this->getFixturesPath().'/'.$expectedMock))
32+
Utils::streamFor(file_get_contents($this->getFixturesPath().'/'.$expectedMock))
3333
);
3434
$actualResponse = $builder->build(
3535
$messageFactory->createRequest($method, $url)
@@ -118,7 +118,7 @@ public function itCanBuildAResponseUsingDomainAliases()
118118
200,
119119
'',
120120
[],
121-
stream_for(file_get_contents($this->getFixturesPath().'/example.com/api/articles.mock'))
121+
Utils::streamFor(file_get_contents($this->getFixturesPath().'/example.com/api/articles.mock'))
122122
);
123123

124124
$actualResponse = $this->getBuilder()->build($messageFactory->createRequest('GET', 'http://foo.bar/api/articles'));
@@ -137,7 +137,7 @@ public function itCanBuildAResponseWithCustomHeaders()
137137
200,
138138
'',
139139
['X-Made-With' => 'PHPUnit'],
140-
stream_for(file_get_contents($this->getFixturesPath().'/example.com/api/articles.mock'))
140+
Utils::streamFor(file_get_contents($this->getFixturesPath().'/example.com/api/articles.mock'))
141141
);
142142

143143
$actualResponse = $this->getBuilder()->build($messageFactory->createRequest('GET', 'http://example.com/api/articles'));
@@ -156,7 +156,7 @@ public function itCanBuildAResponseWithCustomStatus()
156156
500,
157157
'',
158158
[],
159-
stream_for(file_get_contents($this->getFixturesPath().'/example.com/api/articles.mock'))
159+
Utils::streamFor(file_get_contents($this->getFixturesPath().'/example.com/api/articles.mock'))
160160
);
161161
$actualResponse = $this->getBuilder()->build($messageFactory->createRequest('GET', 'http://example.com/api/articles'));
162162

0 commit comments

Comments
 (0)