Skip to content

Commit e19ac43

Browse files
committed
Old/Outdated http-interop/http-factory-guzzle dependency replaced to nyholm/psr7.
1 parent 167372c commit e19ac43

File tree

7 files changed

+12
-16
lines changed

7 files changed

+12
-16
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"composer/semver": "^3.2",
4545
"doctrine/sql-formatter": "^1.1",
4646
"guzzlehttp/psr7": "^2.4.5",
47-
"http-interop/http-factory-guzzle": "^1.0.0",
4847
"illuminate/collections": "^11.0.8",
4948
"illuminate/conditionable": "^11.0.8",
5049
"illuminate/console": "^11.0.8",
@@ -67,6 +66,7 @@
6766
"nette/neon": "^3.4.1",
6867
"nikic/php-parser": "^5.4.0",
6968
"nuwave/lighthouse": "^6.36.0",
69+
"nyholm/psr7": "^1.8",
7070
"opis/json-schema": "^2.3.0",
7171
"phpdocumentor/type-resolver": "^1.7",
7272
"phpstan/phpdoc-parser": "^2.0.0",

packages/testing/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
"ext-mbstring": "*",
2828
"composer/semver": "^3.2",
2929
"doctrine/sql-formatter": "^1.1",
30-
"http-interop/http-factory-guzzle": "^1.0.0",
3130
"illuminate/collections": "^11.0.8",
3231
"illuminate/console": "^11.0.8",
3332
"illuminate/contracts": "^11.0.8",
3433
"illuminate/database": "^11.0.8",
3534
"illuminate/testing": "^11.0.8",
3635
"illuminate/translation": "^11.0.8",
36+
"nyholm/psr7": "^1.8",
3737
"mockery/mockery": "^1.6.5",
3838
"opis/json-schema": "^2.3.0",
3939
"phpunit/phpunit": "^10.5.0|^11.0.0",

packages/testing/src/Constraints/Response/ContentTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace LastDragon_ru\LaraASP\Testing\Constraints\Response;
44

5-
use GuzzleHttp\Psr7\Response;
65
use LastDragon_ru\LaraASP\Testing\Exceptions\InvalidArgumentResponse;
76
use LastDragon_ru\LaraASP\Testing\Testing\TestCase;
7+
use Nyholm\Psr7\Response;
88
use PHPUnit\Framework\Attributes\CoversClass;
99
use stdClass;
1010

packages/testing/src/Constraints/Response/Factory.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
namespace LastDragon_ru\LaraASP\Testing\Constraints\Response;
44

5-
use Http\Factory\Guzzle\ResponseFactory;
6-
use Http\Factory\Guzzle\ServerRequestFactory;
7-
use Http\Factory\Guzzle\StreamFactory;
8-
use Http\Factory\Guzzle\UploadedFileFactory;
95
use Illuminate\Testing\TestResponse;
6+
use Nyholm\Psr7\Factory\Psr17Factory;
107
use Psr\Http\Message\ResponseInterface;
118
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
129
use Symfony\Component\HttpFoundation\Response;
@@ -53,11 +50,10 @@ protected static function create(Response $response): ResponseInterface {
5350
// one time, so we should use a cloned response and cache the
5451
// created PSR response (to avoid double code execution).
5552

56-
return (new PsrHttpFactory(
57-
new ServerRequestFactory(),
58-
new StreamFactory(),
59-
new UploadedFileFactory(),
60-
new ResponseFactory(),
61-
))->createResponse(clone $response);
53+
$psr17Factory = new Psr17Factory();
54+
$psrFactory = new PsrHttpFactory($psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory);
55+
$psrResponse = $psrFactory->createResponse(clone $response);
56+
57+
return $psrResponse;
6258
}
6359
}

packages/testing/src/Constraints/Response/HeaderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace LastDragon_ru\LaraASP\Testing\Constraints\Response;
44

5-
use GuzzleHttp\Psr7\Response;
65
use LastDragon_ru\LaraASP\Testing\Exceptions\InvalidArgumentResponse;
76
use LastDragon_ru\LaraASP\Testing\Testing\TestCase;
7+
use Nyholm\Psr7\Response;
88
use PHPUnit\Framework\Attributes\CoversClass;
99
use PHPUnit\Framework\Constraint\IsEqual;
1010
use stdClass;

packages/testing/src/Constraints/Response/MimeTypeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace LastDragon_ru\LaraASP\Testing\Constraints\Response;
44

5-
use GuzzleHttp\Psr7\Response;
65
use LastDragon_ru\LaraASP\Testing\Exceptions\InvalidArgumentResponse;
76
use LastDragon_ru\LaraASP\Testing\Testing\TestCase;
7+
use Nyholm\Psr7\Response;
88
use PHPUnit\Framework\Attributes\CoversClass;
99
use stdClass;
1010

packages/testing/src/Constraints/Response/StatusCodeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace LastDragon_ru\LaraASP\Testing\Constraints\Response;
44

5-
use GuzzleHttp\Psr7\Response;
65
use LastDragon_ru\LaraASP\Testing\Exceptions\InvalidArgumentResponse;
76
use LastDragon_ru\LaraASP\Testing\Testing\TestCase;
7+
use Nyholm\Psr7\Response;
88
use PHPUnit\Framework\Attributes\CoversClass;
99
use stdClass;
1010

0 commit comments

Comments
 (0)