Skip to content

Commit

Permalink
Import ReflectionClass
Browse files Browse the repository at this point in the history
  • Loading branch information
akrabat committed Dec 12, 2023
1 parent 6013068 commit 4bfb12a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/Factory/AppFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamFactoryInterface;
use ReflectionClass;
use ReflectionProperty;
use RuntimeException;
use Slim\Factory\AppFactory;
Expand Down Expand Up @@ -45,7 +46,7 @@ class AppFactoryTest extends TestCase
{
protected function tearDown(): void
{
$reflectionClass = new \ReflectionClass(SlimHttpPsr17Factory::class);
$reflectionClass = new ReflectionClass(SlimHttpPsr17Factory::class);
$reflectionClass->setStaticPropertyValue('responseFactoryClass', DecoratedResponseFactory::class);
}

Expand Down Expand Up @@ -99,7 +100,7 @@ public function testDetermineResponseFactoryThrowsRuntimeExceptionIfDecoratedNot
'Slim\\Factory\\Psr17\\SlimHttpPsr17Factory could not instantiate a decorated response factory.'
);

$reflectionClass = new \ReflectionClass(SlimHttpPsr17Factory::class);
$reflectionClass = new ReflectionClass(SlimHttpPsr17Factory::class);
$reflectionClass->setStaticPropertyValue('responseFactoryClass', SlimHttpPsr17Factory::class);

Psr17FactoryProvider::setFactories([SlimPsr17Factory::class]);
Expand Down
3 changes: 2 additions & 1 deletion tests/Factory/Psr17/SlimHttpServerRequestCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Slim\Tests\Factory\Psr17;

use Psr\Http\Message\ServerRequestInterface;
use ReflectionClass;
use ReflectionProperty;
use RuntimeException;
use Slim\Factory\Psr17\SlimHttpServerRequestCreator;
Expand Down Expand Up @@ -91,7 +92,7 @@ public function testCreateServerRequestFromGlobalsThrowsRuntimeExceptionIfNotIns

$slimHttpServerRequestCreator = new SlimHttpServerRequestCreator($serverRequestCreatorProphecy->reveal());

$reflectionClass = new \ReflectionClass(SlimHttpServerRequestCreator::class);
$reflectionClass = new ReflectionClass(SlimHttpServerRequestCreator::class);
$reflectionClass->setStaticPropertyValue('serverRequestDecoratorClass', stdClass::class);

$slimHttpServerRequestCreator->createServerRequestFromGlobals();
Expand Down

0 comments on commit 4bfb12a

Please sign in to comment.