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 @@ -18,7 +18,7 @@
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpstan/extension-installer": "^1.4",
"phpunit/phpunit" : "^10.5",
"phpunit/phpunit" : "^11.5",
"rector/rector": "^2.4"
},
"suggest" : {
Expand Down
11 changes: 5 additions & 6 deletions tests/HTTP/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

namespace Sabre\HTTP;

use PHPUnit\Framework\Attributes\DataProvider;

class FunctionsTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider getHeaderValuesDataOnValues2
*
* @param array<int, string> $result
* @param array<int, string> $values1
* @param array<int, string> $values2
*/
#[DataProvider('getHeaderValuesDataOnValues2')]
public function testGetHeaderValuesOnValues2(array $result, array $values1, array $values2): void
{
self::assertEquals($result, getHeaderValues($values1, $values2));
Expand All @@ -38,11 +39,10 @@ public static function getHeaderValuesDataOnValues2(): array
}

/**
* @dataProvider getHeaderValuesData
*
* @param string $input
* @param array<int, mixed> $output
*/
#[DataProvider('getHeaderValuesData')]
public function testGetHeaderValues($input, array $output): void
{
self::assertEquals(
Expand Down Expand Up @@ -81,11 +81,10 @@ public static function getHeaderValuesData(): array
}

/**
* @dataProvider preferData
*
* @param string $input
* @param array<int, mixed> $output
*/
#[DataProvider('preferData')]
public function testPrefer($input, array $output): void
{
self::assertEquals(
Expand Down
5 changes: 3 additions & 2 deletions tests/HTTP/NegotiateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

namespace Sabre\HTTP;

use PHPUnit\Framework\Attributes\DataProvider;

class NegotiateTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider negotiateData
*
* @param array<mixed, mixed> $available
*/
#[DataProvider('negotiateData')]
public function testNegotiate(?string $acceptHeader, array $available, ?string $expected): void
{
self::assertEquals(
Expand Down
20 changes: 9 additions & 11 deletions tests/HTTP/SapiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Sabre\HTTP;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;

class SapiTest extends \PHPUnit\Framework\TestCase
{
public function testConstructFromServerArray(): void
Expand Down Expand Up @@ -144,9 +147,8 @@ public function testSend(): void

/**
* @runInSeparateProcess
*
* @depends testSend
*/
#[Depends('testSend')]
public function testSendLimitedByContentLengthString(): void
{
$response = new Response(200);
Expand Down Expand Up @@ -180,9 +182,8 @@ public function testRecognizeHttp2(): void

/**
* @runInSeparateProcess
*
* @depends testSend
*/
#[Depends('testSend')]
public function testSendLimitedByContentLengthStream(): void
{
$response = new Response(200, ['Content-Length' => 19]);
Expand All @@ -205,17 +206,15 @@ public function testSendLimitedByContentLengthStream(): void

/**
* @runInSeparateProcess
*
* @depends testSend
*
* @dataProvider sendContentRangeStreamData
*/
#[Depends('testSend')]
#[DataProvider('sendContentRangeStreamData')]
public function testSendContentRangeStream(
string $ignoreAtStart,
string $sendText,
int $multiplier,
string $ignoreAtEnd,
?int $contentLength): void
?int $contentLength = null): void
{
$partial = str_repeat($sendText, $multiplier);
$ignoreAtStartLength = strlen($ignoreAtStart);
Expand Down Expand Up @@ -281,9 +280,8 @@ public static function sendContentRangeStreamData(): array

/**
* @runInSeparateProcess
*
* @depends testSend
*/
#[Depends('testSend')]
public function testSendWorksWithCallbackAsBody(): void
{
$response = new Response(200, [], function (): void {
Expand Down
17 changes: 6 additions & 11 deletions tests/HTTP/URLUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Sabre\HTTP;

use PHPUnit\Framework\Attributes\Depends;

class URLUtilTest extends \PHPUnit\Framework\TestCase
{
public function testEncodePath(): void
Expand Down Expand Up @@ -61,19 +63,15 @@ public function testDecode(): void
self::assertEquals('Hello Test+Test2.txt', $newStr);
}

/**
* @depends testDecode
*/
#[Depends('testDecode')]
public function testDecodeUmlaut(): void
{
$str = 'Hello%C3%BC.txt';
$newStr = decodePath($str);
self::assertEquals("Hello\xC3\xBC.txt", $newStr);
}

/**
* @depends testDecode
*/
#[Depends('testDecode')]
public function testDecodeSlavicWords(): void
{
$words = [
Expand All @@ -90,9 +88,7 @@ public function testDecodeSlavicWords(): void
}
}

/**
* @depends testDecodeUmlaut
*/
#[Depends('testDecodeUmlaut')]
public function testDecodeUmlautLatin1(): void
{
$str = 'Hello%FC.txt';
Expand All @@ -102,9 +98,8 @@ public function testDecodeUmlautLatin1(): void

/**
* This testcase was sent by a bug reporter.
*
* @depends testDecode
*/
#[Depends('testDecode')]
public function testDecodeAccentsWindows7(): void
{
$str = '/webdav/%C3%A0fo%C3%B3';
Expand Down