mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 09:43:13 +08:00
Migrated rest actions to psr-15 middleware
This commit is contained in:
@@ -5,13 +5,13 @@ use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\Core\Service\ShortUrlService;
|
||||
use Shlinkio\Shlink\Rest\Action\ListShortcodesAction;
|
||||
use Zend\Diactoros\Response;
|
||||
use ShlinkioTest\Shlink\Common\Util\TestUtils;
|
||||
use Zend\Diactoros\ServerRequestFactory;
|
||||
use Zend\I18n\Translator\Translator;
|
||||
use Zend\Paginator\Adapter\ArrayAdapter;
|
||||
use Zend\Paginator\Paginator;
|
||||
|
||||
class ListShortcodesActionTest extends TestCase
|
||||
class ListShortCodesActionTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var ListShortcodesAction
|
||||
@@ -37,11 +37,11 @@ class ListShortcodesActionTest extends TestCase
|
||||
$this->service->listShortUrls($page, null, [], null)->willReturn(new Paginator(new ArrayAdapter()))
|
||||
->shouldBeCalledTimes(1);
|
||||
|
||||
$response = $this->action->__invoke(
|
||||
$response = $this->action->process(
|
||||
ServerRequestFactory::fromGlobals()->withQueryParams([
|
||||
'page' => $page,
|
||||
]),
|
||||
new Response()
|
||||
TestUtils::createDelegateMock()->reveal()
|
||||
);
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
@@ -55,11 +55,11 @@ class ListShortcodesActionTest extends TestCase
|
||||
$this->service->listShortUrls($page, null, [], null)->willThrow(\Exception::class)
|
||||
->shouldBeCalledTimes(1);
|
||||
|
||||
$response = $this->action->__invoke(
|
||||
$response = $this->action->process(
|
||||
ServerRequestFactory::fromGlobals()->withQueryParams([
|
||||
'page' => $page,
|
||||
]),
|
||||
new Response()
|
||||
TestUtils::createDelegateMock()->reveal()
|
||||
);
|
||||
$this->assertEquals(500, $response->getStatusCode());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user