mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Fixed use of ImplicitOptionsMiddleware with its new signature
This commit is contained in:
@@ -7,6 +7,7 @@ namespace ShlinkioTest\Shlink\Rest\Middleware;
|
||||
use Laminas\Diactoros\Response\EmptyResponse;
|
||||
use Mezzio\Router\Middleware\ImplicitOptionsMiddleware;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Http\Message\ResponseFactoryInterface;
|
||||
use ReflectionObject;
|
||||
use Shlinkio\Shlink\Rest\Middleware\EmptyResponseImplicitOptionsMiddlewareFactory;
|
||||
|
||||
@@ -34,6 +35,10 @@ class EmptyResponseImplicitOptionsMiddlewareFactoryTest extends TestCase
|
||||
$ref = new ReflectionObject($instance);
|
||||
$prop = $ref->getProperty('responseFactory');
|
||||
$prop->setAccessible(true);
|
||||
self::assertInstanceOf(EmptyResponse::class, $prop->getValue($instance)());
|
||||
|
||||
/** @var ResponseFactoryInterface $value */
|
||||
$value = $prop->getValue($instance);
|
||||
|
||||
self::assertInstanceOf(EmptyResponse::class, $value->createResponse());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user