Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"require": {
"php": "^7.3 || ^8.0",
"phpunit/phpunit": "^9.3 || ^10.0",
"phpunit/phpunit": "^9.3 || ^10.0 || ^11.5 || ^12.4",
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
Expand Down
3 changes: 3 additions & 0 deletions src/MessageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use InvalidArgumentException;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Attributes\DataProvider;
use Psr\Http\Message\MessageInterface;
use Throwable;
use TypeError;
Expand Down Expand Up @@ -135,6 +136,7 @@ public function testWithHeader()
/**
* @dataProvider getInvalidHeaderArguments
*/
#[DataProvider('getInvalidHeaderArguments')]
public function testWithHeaderInvalidArguments($name, $value)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down Expand Up @@ -188,6 +190,7 @@ public function testWithAddedHeader()
/**
* @dataProvider getInvalidHeaderArguments
*/
#[DataProvider('getInvalidHeaderArguments')]
public function testWithAddedHeaderInvalidArguments($name, $value)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down
2 changes: 2 additions & 0 deletions src/RequestIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use InvalidArgumentException;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Attributes\DataProvider;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\UriInterface;
use Throwable;
Expand Down Expand Up @@ -94,6 +95,7 @@ public function testMethodIsExtendable()
/**
* @dataProvider getInvalidMethods
*/
#[DataProvider('getInvalidMethods')]
public function testMethodWithInvalidArguments($method)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down
2 changes: 2 additions & 0 deletions src/ResponseIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use InvalidArgumentException;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Attributes\DataProvider;
use Psr\Http\Message\ResponseInterface;
use Throwable;
use TypeError;
Expand Down Expand Up @@ -56,6 +57,7 @@ public function testStatusCode()
/**
* @dataProvider getInvalidStatusCodeArguments
*/
#[DataProvider('getInvalidStatusCodeArguments')]
public function testStatusCodeInvalidArgument($statusCode)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down
3 changes: 3 additions & 0 deletions src/ServerRequestIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Http\Psr7Test;

use PHPUnit\Framework\Attributes\DataProvider;
use Psr\Http\Message\ServerRequestInterface;

/**
Expand Down Expand Up @@ -88,6 +89,7 @@ public function testGetUploadedFiles()
/**
* @dataProvider validParsedBodyParams
*/
#[DataProvider('validParsedBodyParams')]
public function testGetParsedBody($value)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand All @@ -111,6 +113,7 @@ public static function validParsedBodyParams()
/**
* @dataProvider invalidParsedBodyParams
*/
#[DataProvider('invalidParsedBodyParams')]
public function testGetParsedBodyInvalid($value)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down
7 changes: 7 additions & 0 deletions src/UriIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use InvalidArgumentException;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;
use Psr\Http\Message\UriInterface;
use Throwable;
use TypeError;
Expand Down Expand Up @@ -45,6 +47,7 @@ public function testScheme()
/**
* @dataProvider getInvalidSchemaArguments
*/
#[DataProvider('getInvalidSchemaArguments')]
public function testWithSchemeInvalidArguments($schema)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down Expand Up @@ -155,6 +158,7 @@ public function testPort()
/**
* @dataProvider getPaths
*/
#[DataProvider('getPaths')]
public function testPath(UriInterface $uri, string $expected)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand All @@ -181,6 +185,7 @@ public static function getPaths()
/**
* @dataProvider getQueries
*/
#[DataProvider('getQueries')]
public function testQuery(UriInterface $uri, string $expected)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand All @@ -206,6 +211,7 @@ public static function getQueries()
/**
* @dataProvider getFragments
*/
#[DataProvider('getFragments')]
public function testFragment(UriInterface $uri, string $expected)
{
if (isset($this->skippedTests[__FUNCTION__])) {
Expand Down Expand Up @@ -304,6 +310,7 @@ public function testGetPathNormalizesMultipleLeadingSlashesToSingleSlashToPreven
*
* @psalm-param array{expected: non-empty-string, uri: UriInterface} $test
*/
#[Depends('testGetPathNormalizesMultipleLeadingSlashesToSingleSlashToPreventXSS')]
public function testStringRepresentationWithMultipleSlashes(array $test)
{
$this->assertSame($test['expected'], (string) $test['uri']);
Expand Down
Loading