From e3aa6b57a5a91c7940618b0215dbb2ea74be238f Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Fri, 31 Oct 2025 10:12:46 +0000 Subject: [PATCH 1/3] Remove Prophecy We prefer to use PHPUnit's built-in mocking support. --- composer.json | 6 ++---- tests/StreamTest.php | 13 +++---------- tests/UploadedFileTest.php | 16 +++++----------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/composer.json b/composer.json index 20b6e02..618e980 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,6 @@ "adriansuter/php-autoload-override": "^1.5|| ^2.0", "http-interop/http-factory-tests": "^1.0 || ^2.0", "php-http/psr7-integration-tests": "^1.4", - "phpspec/prophecy": "^1.22", - "phpspec/prophecy-phpunit": "^2.2", "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^9.6 || ^10", "squizlabs/php_codesniffer": "^3.13" @@ -61,9 +59,9 @@ }, "scripts": { "test": [ - "@phpunit", "@phpcs", - "@phpstan" + "@phpstan", + "@phpunit" ], "phpunit": "@php phpunit", "phpcs": "@php phpcs", diff --git a/tests/StreamTest.php b/tests/StreamTest.php index 0a97197..0cefec8 100644 --- a/tests/StreamTest.php +++ b/tests/StreamTest.php @@ -11,7 +11,6 @@ namespace Slim\Tests\Psr7; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; use ReflectionException; use ReflectionMethod; use ReflectionProperty; @@ -25,8 +24,6 @@ class StreamTest extends TestCase { - use ProphecyTrait; - /** * @var resource pipe stream file handle */ @@ -184,13 +181,9 @@ public function testAttachAgain() { $this->openPipeStream(); - $streamProphecy = $this->prophesize(Stream::class); - - /** @noinspection PhpUndefinedMethodInspection */ - $streamProphecy->detach()->shouldBeCalled(); - - /** @var Stream $stream */ - $stream = $streamProphecy->reveal(); + $stream = $this->createMock(Stream::class); + $stream->expects($this->once()) + ->method('detach'); $streamProperty = new ReflectionProperty(Stream::class, 'stream'); $streamProperty->setAccessible(true); diff --git a/tests/UploadedFileTest.php b/tests/UploadedFileTest.php index 9fde48d..c34cd13 100644 --- a/tests/UploadedFileTest.php +++ b/tests/UploadedFileTest.php @@ -14,7 +14,6 @@ use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Depends; -use Prophecy\PhpUnit\ProphecyTrait; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; use ReflectionProperty; @@ -46,8 +45,6 @@ class UploadedFileTest extends TestCase { - use ProphecyTrait; - private static string $filename = './phpUxcOty'; private static array $tmpFiles = ['./phpUxcOty']; @@ -428,14 +425,11 @@ public function testCreateUploadedFileWithInvalidUri() { $this->expectException(InvalidArgumentException::class); - $streamProphecy = $this->prophesize(StreamInterface::class); - - /** @noinspection PhpUndefinedMethodInspection */ - $streamProphecy - ->getMetadata('uri') - ->willReturn(null) - ->shouldBeCalled(); - $stream = $streamProphecy->reveal(); + $stream = $this->createMock(StreamInterface::class); + $stream->expects($this->once()) + ->method('getMetadata') + ->with('uri') + ->willReturn(null); // Test with a StreamInterface that returns `null` // when `$stream->getMetadata('uri')` is called (which is an invalid case). From 2a8835d08bb160d30b8b08309e42edcab92c280c Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Fri, 31 Oct 2025 10:13:20 +0000 Subject: [PATCH 2/3] Only call setAccessible() for PHP < 8.1 setAccessible() is only required for PHP versions less than 8.1 and is deprecated from 8.5. --- tests/BodyTest.php | 31 +++++++---- tests/CookiesTest.php | 24 ++++++--- tests/Factory/ServerRequestFactoryTest.php | 13 ++++- tests/Factory/UploadedFileFactoryTest.php | 63 +++++++--------------- tests/RequestTest.php | 29 ++++++---- tests/ResponseTest.php | 21 +++++--- tests/StreamTest.php | 17 ++++-- tests/UploadedFileTest.php | 12 ++++- 8 files changed, 127 insertions(+), 83 deletions(-) diff --git a/tests/BodyTest.php b/tests/BodyTest.php index de1d8de..8049750 100644 --- a/tests/BodyTest.php +++ b/tests/BodyTest.php @@ -47,6 +47,15 @@ protected function tearDown(): void } } + protected function setAccessible(ReflectionProperty $property, bool $accessible = true): void + { + // only if PHP version < 8.1 + if (PHP_VERSION_ID > 80100) { + return; + } + $property->setAccessible($accessible); + } + /** * @param string $mode * @@ -66,7 +75,7 @@ public function testConstructorAttachesStream() $this->stream = $this->resourceFactory(); $body = new Stream($this->stream); $bodyStream = new ReflectionProperty($body, 'stream'); - $bodyStream->setAccessible(true); + $this->setAccessible($bodyStream); $this->assertSame($this->stream, $bodyStream->getValue($body)); } @@ -109,19 +118,19 @@ public function testDetach() $body = new Stream($this->stream); $bodyStream = new ReflectionProperty($body, 'stream'); - $bodyStream->setAccessible(true); + $this->setAccessible($bodyStream); $bodyMetadata = new ReflectionProperty($body, 'meta'); - $bodyMetadata->setAccessible(true); + $this->setAccessible($bodyMetadata); $bodyReadable = new ReflectionProperty($body, 'readable'); - $bodyReadable->setAccessible(true); + $this->setAccessible($bodyReadable); $bodyWritable = new ReflectionProperty($body, 'writable'); - $bodyWritable->setAccessible(true); + $this->setAccessible($bodyWritable); $bodySeekable = new ReflectionProperty($body, 'seekable'); - $bodySeekable->setAccessible(true); + $this->setAccessible($bodySeekable); $result = $body->detach(); @@ -156,7 +165,7 @@ public function testToStringDetached() $this->stream = $this->resourceFactory(); $body = new Stream($this->stream); $bodyStream = new ReflectionProperty($body, 'stream'); - $bodyStream->setAccessible(true); + $this->setAccessible($bodyStream); $bodyStream->setValue($body, null); $this->assertEquals('', (string) $body); @@ -169,7 +178,7 @@ public function testClose() $body->close(); $bodyStream = new ReflectionProperty($body, 'stream'); - $bodyStream->setAccessible(true); + $this->setAccessible($bodyStream); $this->assertNull($bodyStream->getValue($body)); } @@ -187,7 +196,7 @@ public function testGetSizeDetached() $this->stream = $this->resourceFactory(); $body = new Stream($this->stream); $bodyStream = new ReflectionProperty($body, 'stream'); - $bodyStream->setAccessible(true); + $this->setAccessible($bodyStream); $bodyStream->setValue($body, null); $this->assertNull($body->getSize()); @@ -209,7 +218,7 @@ public function testTellDetachedThrowsRuntimeException() $this->stream = $this->resourceFactory(); $body = new Stream($this->stream); $bodyStream = new ReflectionProperty($body, 'stream'); - $bodyStream->setAccessible(true); + $this->setAccessible($bodyStream); $bodyStream->setValue($body, null); $body->tell(); @@ -240,7 +249,7 @@ public function testEofDetached() $this->stream = $this->resourceFactory(); $body = new Stream($this->stream); $bodyStream = new ReflectionProperty($body, 'stream'); - $bodyStream->setAccessible(true); + $this->setAccessible($bodyStream); $bodyStream->setValue($body, null); $this->assertTrue($body->eof()); diff --git a/tests/CookiesTest.php b/tests/CookiesTest.php index 8a1cc86..d365ac1 100644 --- a/tests/CookiesTest.php +++ b/tests/CookiesTest.php @@ -13,6 +13,7 @@ use InvalidArgumentException; use PHPUnit\Framework\TestCase; use ReflectionClass; +use ReflectionMethod; use ReflectionProperty; use Slim\Psr7\Cookies; use stdClass; @@ -30,11 +31,20 @@ public function testConstructor() 'test' => 'Works', ]); $prop = new ReflectionProperty($cookies, 'requestCookies'); - $prop->setAccessible(true); + $this->setAccessible($prop); $this->assertNotEmpty($prop->getValue($cookies)['test']); $this->assertEquals('Works', $prop->getValue($cookies)['test']); } + protected function setAccessible(ReflectionProperty|ReflectionMethod $property, bool $accessible = true): void + { + // only if PHP version < 8.1 + if (PHP_VERSION_ID > 80100) { + return; + } + $property->setAccessible($accessible); + } + public function testSetDefaults() { $defaults = [ @@ -51,7 +61,7 @@ public function testSetDefaults() $cookies = new Cookies(); $prop = new ReflectionProperty($cookies, 'defaults'); - $prop->setAccessible(true); + $this->setAccessible($prop); $origDefaults = $prop->getValue($cookies); @@ -67,7 +77,7 @@ public function testSetCookieValues() $cookies->set('foo', 'bar'); $prop = new ReflectionProperty($cookies, 'responseCookies'); - $prop->setAccessible(true); + $this->setAccessible($prop); $expectedValue = [ 'foo' => [ @@ -103,7 +113,7 @@ public function testSetCookieValuesContainDefaults() $cookies->set('foo', 'bar'); $prop = new ReflectionProperty($cookies, 'responseCookies'); - $prop->setAccessible(true); + $this->setAccessible($prop); $expectedValue = [ 'foo' => [ @@ -139,7 +149,7 @@ public function testSetCookieValuesCanOverrideDefaults() $cookies->set('foo', ['value' => 'bar', 'secure' => false, 'samesite' => 'strict']); $prop = new ReflectionProperty($cookies, 'responseCookies'); - $prop->setAccessible(true); + $this->setAccessible($prop); $expectedValue = [ 'foo' => [ @@ -169,7 +179,7 @@ public function testSetSameSiteCookieValuesAreCaseInsensitive() $cookies->set('breakfast', ['samesite' => 'StricT']); $prop = new ReflectionProperty($cookies, 'responseCookies'); - $prop->setAccessible(true); + $this->setAccessible($prop); $expectedValue = [ 'breakfast' => [ @@ -224,7 +234,7 @@ public function testToHeader() $cookies = new Cookies(); $class = new ReflectionClass($cookies); $method = $class->getMethod('toHeader'); - $method->setAccessible(true); + $this->setAccessible($method); $properties = [ 'name' => 'test', 'properties' => [ diff --git a/tests/Factory/ServerRequestFactoryTest.php b/tests/Factory/ServerRequestFactoryTest.php index d46be55..1682948 100644 --- a/tests/Factory/ServerRequestFactoryTest.php +++ b/tests/Factory/ServerRequestFactoryTest.php @@ -14,6 +14,8 @@ use InvalidArgumentException; use Psr\Http\Message\UriInterface; use ReflectionClass; +use ReflectionMethod; +use ReflectionProperty; use Slim\Psr7\Environment; use Slim\Psr7\Factory\ServerRequestFactory; use Slim\Psr7\Factory\UriFactory; @@ -25,6 +27,15 @@ class ServerRequestFactoryTest extends ServerRequestFactoryTestCase { + protected function setAccessible(ReflectionProperty|ReflectionMethod $property, bool $accessible = true): void + { + // only if PHP version < 8.1 + if (PHP_VERSION_ID > 80100) { + return; + } + $property->setAccessible($accessible); + } + protected function createServerRequestFactory(): ServerRequestFactory { return new ServerRequestFactory(); @@ -123,7 +134,7 @@ public function testCreateFromGlobalsSetsACache() $stream = $request->getBody(); $class = new ReflectionClass($stream); $property = $class->getProperty('cache'); - $property->setAccessible(true); + $this->setAccessible($property); $cacheStreamValue = $property->getValue($stream); $this->assertNotNull($cacheStreamValue); } diff --git a/tests/Factory/UploadedFileFactoryTest.php b/tests/Factory/UploadedFileFactoryTest.php index 1f46b79..ec10094 100644 --- a/tests/Factory/UploadedFileFactoryTest.php +++ b/tests/Factory/UploadedFileFactoryTest.php @@ -12,7 +12,6 @@ use Interop\Http\Factory\UploadedFileFactoryTestCase; use InvalidArgumentException; -use Prophecy\PhpUnit\ProphecyTrait; use Psr\Http\Message\StreamInterface; use Slim\Psr7\Factory\StreamFactory; use Slim\Psr7\Factory\UploadedFileFactory; @@ -25,8 +24,6 @@ class UploadedFileFactoryTest extends UploadedFileFactoryTestCase { - use ProphecyTrait; - protected function createUploadedFileFactory(): UploadedFileFactory { return new UploadedFileFactory(); @@ -43,25 +40,20 @@ protected function createStream($content): StreamInterface } /** - * Prophesize a `\Psr\Http\Message\StreamInterface` with a `getMetadata` method prophecy. + * Create a `\Psr\Http\Message\StreamInterface` mock with a `getMetadata` method expectation. * - * @param string $argKey Argument for the method prophecy. + * @param string $argKey Argument for the method expectation. * @param mixed $returnValue Return value of the `getMetadata` method. * * @return StreamInterface */ protected function prophesizeStreamInterfaceWithGetMetadataMethod(string $argKey, $returnValue): StreamInterface { - $streamProphecy = $this->prophesize(StreamInterface::class); - - /** @noinspection PhpUndefinedMethodInspection */ - $streamProphecy - ->getMetadata($argKey) - ->willReturn($returnValue) - ->shouldBeCalled(); - - /** @var StreamInterface $stream */ - $stream = $streamProphecy->reveal(); + $stream = $this->createMock(StreamInterface::class); + $stream->expects($this->once()) + ->method('getMetadata') + ->with($argKey) + ->willReturn($returnValue); return $stream; } @@ -71,17 +63,11 @@ public function testCreateUploadedFileWithInvalidUri() $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('File is not readable.'); - // Prophesize a `\Psr\Http\Message\StreamInterface` with a `getMetadata` method prophecy. - $streamProphecy = $this->prophesize(StreamInterface::class); - - /** @noinspection PhpUndefinedMethodInspection */ - $streamProphecy - ->getMetadata('uri') - ->willReturn(null) - ->shouldBeCalled(); - - /** @var StreamInterface $stream */ - $stream = $streamProphecy->reveal(); + $stream = $this->createMock(StreamInterface::class); + $stream->expects($this->once()) + ->method('getMetadata') + ->with('uri') + ->willReturn(null); $this->factory->createUploadedFile($stream); } @@ -91,23 +77,14 @@ public function testCreateUploadedFileWithNonReadableFile() $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('File is not readable.'); - // Prophesize a `\Psr\Http\Message\StreamInterface` with a `getMetadata` and `isReadable` method prophecies. - $streamProphecy = $this->prophesize(StreamInterface::class); - - /** @noinspection PhpUndefinedMethodInspection */ - $streamProphecy - ->getMetadata('uri') - ->willReturn('non-readable') - ->shouldBeCalled(); - - /** @noinspection PhpUndefinedMethodInspection */ - $streamProphecy - ->isReadable() - ->willReturn(false) - ->shouldBeCalled(); - - /** @var StreamInterface $stream */ - $stream = $streamProphecy->reveal(); + $stream = $this->createMock(StreamInterface::class); + $stream->expects($this->once()) + ->method('getMetadata') + ->with('uri') + ->willReturn('non-readable'); + $stream->expects($this->once()) + ->method('isReadable') + ->willReturn(false); $this->factory->createUploadedFile($stream); } diff --git a/tests/RequestTest.php b/tests/RequestTest.php index da54f98..8f3dc90 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -26,6 +26,15 @@ class RequestTest extends TestCase { + protected function setAccessible(ReflectionProperty|ReflectionMethod $property, bool $accessible = true): void + { + // only if PHP version < 8.1 + if (PHP_VERSION_ID > 80100) { + return; + } + $property->setAccessible($accessible); + } + public function requestFactory($envData = []): Request { $env = Environment::mock($envData); @@ -126,7 +135,7 @@ public function testGetRequestTargetAlreadySet() { $request = $this->requestFactory(); $prop = new ReflectionProperty($request, 'requestTarget'); - $prop->setAccessible(true); + $this->setAccessible($prop); $prop->setValue($request, '/foo/bar?abc=123'); $this->assertEquals('/foo/bar?abc=123', $request->getRequestTarget()); @@ -136,7 +145,7 @@ public function testGetRequestTargetIfNoUri() { $request = $this->requestFactory(); $prop = new ReflectionProperty($request, 'uri'); - $prop->setAccessible(true); + $this->setAccessible($prop); $prop->setValue($request, null); $this->assertEquals('/', $request->getRequestTarget()); @@ -248,7 +257,7 @@ public function testGetQueryParamsAlreadySet() { $request = $this->requestFactory(); $prop = new ReflectionProperty($request, 'queryParams'); - $prop->setAccessible(true); + $this->setAccessible($prop); $prop->setValue($request, ['foo' => 'bar']); $this->assertEquals(['foo' => 'bar'], $request->getQueryParams()); @@ -278,7 +287,7 @@ public function testGetQueryParamsWithoutUri() { $request = $this->requestFactory(); $prop = new ReflectionProperty($request, 'uri'); - $prop->setAccessible(true); + $this->setAccessible($prop); $prop->setValue($request, null); $this->assertEquals([], $request->getQueryParams()); @@ -323,7 +332,7 @@ public function testGetAttributes() { $request = $this->requestFactory(); $attrProp = new ReflectionProperty($request, 'attributes'); - $attrProp->setAccessible(true); + $this->setAccessible($attrProp); $attrProp->setValue($request, ['foo' => 'bar']); $this->assertEquals(['foo' => 'bar'], $request->getAttributes()); @@ -333,7 +342,7 @@ public function testGetAttribute() { $request = $this->requestFactory(); $attrProp = new ReflectionProperty($request, 'attributes'); - $attrProp->setAccessible(true); + $this->setAccessible($attrProp); $attrProp->setValue($request, ['foo' => 'bar']); $this->assertEquals('bar', $request->getAttribute('foo')); @@ -345,7 +354,7 @@ public function testWithAttribute() { $request = $this->requestFactory(); $attrProp = new ReflectionProperty($request, 'attributes'); - $attrProp->setAccessible(true); + $this->setAccessible($attrProp); $attrProp->setValue($request, ['foo' => 'bar']); $clone = $request->withAttribute('test', '123'); @@ -356,7 +365,7 @@ public function testWithoutAttribute() { $request = $this->requestFactory(); $attrProp = new ReflectionProperty($request, 'attributes'); - $attrProp->setAccessible(true); + $this->setAccessible($attrProp); $attrProp->setValue($request, ['foo' => 'bar']); $clone = $request->withoutAttribute('foo'); @@ -367,7 +376,7 @@ public function testGetParsedBodyWhenAlreadyParsed() { $request = $this->requestFactory(); $prop = new ReflectionProperty($request, 'parsedBody'); - $prop->setAccessible(true); + $this->setAccessible($prop); $prop->setValue($request, ['foo' => 'bar']); $this->assertEquals(['foo' => 'bar'], $request->getParsedBody()); @@ -377,7 +386,7 @@ public function testGetParsedBodyWhenBodyDoesNotExist() { $request = $this->requestFactory(); $prop = new ReflectionProperty($request, 'body'); - $prop->setAccessible(true); + $this->setAccessible($prop); $prop->setValue($request, null); $this->assertNull($request->getParsedBody()); diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index 7b73488..ed63cf6 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -24,15 +24,24 @@ class ResponseTest extends TestCase { + protected function setAccessible(ReflectionProperty|ReflectionMethod $property, bool $accessible = true): void + { + // only if PHP version < 8.1 + if (PHP_VERSION_ID > 80100) { + return; + } + $property->setAccessible($accessible); + } + public function testConstructorWithDefaultArgs() { $response = new Response(); $headersReflection = new ReflectionProperty($response, 'headers'); - $headersReflection->setAccessible(true); + $this->setAccessible($headersReflection); $bodyReflection = new ReflectionProperty($response, 'body'); - $bodyReflection->setAccessible(true); + $this->setAccessible($bodyReflection); $this->assertEquals(200, $response->getStatusCode()); $this->assertInstanceOf(Headers::class, $headersReflection->getValue($response)); @@ -46,10 +55,10 @@ public function testConstructorWithCustomArgs() $response = new Response(404, $headers, $body); $headersReflection = new ReflectionProperty($response, 'headers'); - $headersReflection->setAccessible(true); + $this->setAccessible($headersReflection); $bodyReflection = new ReflectionProperty($response, 'body'); - $bodyReflection->setAccessible(true); + $this->setAccessible($bodyReflection); $this->assertEquals(404, $response->getStatusCode()); $this->assertSame($headers, $headersReflection->getValue($response)); @@ -64,7 +73,7 @@ public function testDeepCopyClone() $clone = clone $response; $headersReflection = new ReflectionProperty($response, 'headers'); - $headersReflection->setAccessible(true); + $this->setAccessible($headersReflection); $this->assertEquals(404, $clone->getStatusCode()); $this->assertEquals('1.1', $clone->getProtocolVersion()); @@ -83,7 +92,7 @@ public function testGetStatusCode() { $response = new Response(); $responseStatus = new ReflectionProperty($response, 'status'); - $responseStatus->setAccessible(true); + $this->setAccessible($responseStatus); $responseStatus->setValue($response, 404); $this->assertEquals(404, $response->getStatusCode()); diff --git a/tests/StreamTest.php b/tests/StreamTest.php index 0cefec8..24ffe3e 100644 --- a/tests/StreamTest.php +++ b/tests/StreamTest.php @@ -39,6 +39,15 @@ public function tearDown(): void } } + protected function setAccessible(ReflectionProperty|ReflectionMethod $property, bool $accessible = true): void + { + // only if PHP version < 8.1 + if (PHP_VERSION_ID > 80100) { + return; + } + $property->setAccessible($accessible); + } + public function testIsPipe() { $this->openPipeStream(); @@ -186,11 +195,11 @@ public function testAttachAgain() ->method('detach'); $streamProperty = new ReflectionProperty(Stream::class, 'stream'); - $streamProperty->setAccessible(true); + $this->setAccessible($streamProperty); $streamProperty->setValue($stream, $this->pipeFh); $attachMethod = new ReflectionMethod(Stream::class, 'attach'); - $attachMethod->setAccessible(true); + $this->setAccessible($attachMethod); $attachMethod->invoke($stream, $this->pipeFh); } @@ -257,9 +266,9 @@ public function testDetachingStreamDropsCache() $stream->detach(); $cacheProperty = new ReflectionProperty(Stream::class, 'cache'); - $cacheProperty->setAccessible(true); + $this->setAccessible($cacheProperty); $finishedProperty = new ReflectionProperty(Stream::class, 'finished'); - $finishedProperty->setAccessible(true); + $this->setAccessible($finishedProperty); $this->assertNull($cacheProperty->getValue($stream)); $this->assertFalse($finishedProperty->getValue($stream)); diff --git a/tests/UploadedFileTest.php b/tests/UploadedFileTest.php index c34cd13..8d53313 100644 --- a/tests/UploadedFileTest.php +++ b/tests/UploadedFileTest.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\Attributes\Depends; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; +use ReflectionMethod; use ReflectionProperty; use RuntimeException; use Slim\Psr7\Environment; @@ -78,6 +79,15 @@ public function tearDown(): void } } + protected function setAccessible(ReflectionProperty|ReflectionMethod $property, bool $accessible = true): void + { + // only if PHP version < 8.1 + if (PHP_VERSION_ID > 80100) { + return; + } + $property->setAccessible($accessible); + } + protected function generateNewTmpFile(): UploadedFile { $filename = './php' . microtime(); @@ -347,7 +357,7 @@ public function testMoveToStream() $uploadedFile = $this->generateNewTmpFile(); $fileProperty = new ReflectionProperty($uploadedFile, 'file'); - $fileProperty->setAccessible(true); + $this->setAccessible($fileProperty); $fileName = $fileProperty->getValue($uploadedFile); $contents = file_get_contents($fileName); From 626c76341e5b776e30dc415a3e6aeaf39f2f7ee9 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Fri, 31 Oct 2025 10:15:14 +0000 Subject: [PATCH 3/3] Add PHP 8.5 to the CI matrix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 995b692..9d67723 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.0, 8.1, 8.2, 8.3, 8.4] + php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5] experimental: [false] composer-options: [''] include: