mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 19:59:04 +03:00
Removed uneeded inline type hints
This commit is contained in:
parent
687a1cc9c7
commit
38cc83a4ee
12 changed files with 0 additions and 40 deletions
|
@ -5,7 +5,6 @@ namespace ShlinkioTest\Shlink\CLI\Command\Tag;
|
||||||
|
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\CLI\Command\Tag\CreateTagCommand;
|
use Shlinkio\Shlink\CLI\Command\Tag\CreateTagCommand;
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
|
@ -43,7 +42,6 @@ class CreateTagCommandTest extends TestCase
|
||||||
public function serviceIsInvokedOnSuccess()
|
public function serviceIsInvokedOnSuccess()
|
||||||
{
|
{
|
||||||
$tagNames = ['foo', 'bar'];
|
$tagNames = ['foo', 'bar'];
|
||||||
/** @var MethodProphecy $createTags */
|
|
||||||
$createTags = $this->tagService->createTags($tagNames)->willReturn(new ArrayCollection());
|
$createTags = $this->tagService->createTags($tagNames)->willReturn(new ArrayCollection());
|
||||||
|
|
||||||
$this->commandTester->execute([
|
$this->commandTester->execute([
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
|
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\CLI\Command\Tag\DeleteTagsCommand;
|
use Shlinkio\Shlink\CLI\Command\Tag\DeleteTagsCommand;
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
|
@ -44,7 +43,6 @@ class DeleteTagsCommandTest extends TestCase
|
||||||
public function serviceIsInvokedOnSuccess()
|
public function serviceIsInvokedOnSuccess()
|
||||||
{
|
{
|
||||||
$tagNames = ['foo', 'bar'];
|
$tagNames = ['foo', 'bar'];
|
||||||
/** @var MethodProphecy $deleteTags */
|
|
||||||
$deleteTags = $this->tagService->deleteTags($tagNames)->will(function () {
|
$deleteTags = $this->tagService->deleteTags($tagNames)->will(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
|
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\CLI\Command\Tag\ListTagsCommand;
|
use Shlinkio\Shlink\CLI\Command\Tag\ListTagsCommand;
|
||||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||||
|
@ -35,7 +34,6 @@ class ListTagsCommandTest extends TestCase
|
||||||
/** @test */
|
/** @test */
|
||||||
public function noTagsPrintsEmptyMessage()
|
public function noTagsPrintsEmptyMessage()
|
||||||
{
|
{
|
||||||
/** @var MethodProphecy $listTags */
|
|
||||||
$listTags = $this->tagService->listTags()->willReturn([]);
|
$listTags = $this->tagService->listTags()->willReturn([]);
|
||||||
|
|
||||||
$this->commandTester->execute([]);
|
$this->commandTester->execute([]);
|
||||||
|
@ -48,7 +46,6 @@ class ListTagsCommandTest extends TestCase
|
||||||
/** @test */
|
/** @test */
|
||||||
public function listOfTagsIsPrinted()
|
public function listOfTagsIsPrinted()
|
||||||
{
|
{
|
||||||
/** @var MethodProphecy $listTags */
|
|
||||||
$listTags = $this->tagService->listTags()->willReturn([
|
$listTags = $this->tagService->listTags()->willReturn([
|
||||||
new Tag('foo'),
|
new Tag('foo'),
|
||||||
new Tag('bar'),
|
new Tag('bar'),
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
|
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\CLI\Command\Tag\RenameTagCommand;
|
use Shlinkio\Shlink\CLI\Command\Tag\RenameTagCommand;
|
||||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||||
|
@ -38,7 +37,6 @@ class RenameTagCommandTest extends TestCase
|
||||||
{
|
{
|
||||||
$oldName = 'foo';
|
$oldName = 'foo';
|
||||||
$newName = 'bar';
|
$newName = 'bar';
|
||||||
/** @var MethodProphecy $renameTag */
|
|
||||||
$renameTag = $this->tagService->renameTag($oldName, $newName)->willThrow(EntityDoesNotExistException::class);
|
$renameTag = $this->tagService->renameTag($oldName, $newName)->willThrow(EntityDoesNotExistException::class);
|
||||||
|
|
||||||
$this->commandTester->execute([
|
$this->commandTester->execute([
|
||||||
|
@ -56,7 +54,6 @@ class RenameTagCommandTest extends TestCase
|
||||||
{
|
{
|
||||||
$oldName = 'foo';
|
$oldName = 'foo';
|
||||||
$newName = 'bar';
|
$newName = 'bar';
|
||||||
/** @var MethodProphecy $renameTag */
|
|
||||||
$renameTag = $this->tagService->renameTag($oldName, $newName)->willReturn(new Tag($newName));
|
$renameTag = $this->tagService->renameTag($oldName, $newName)->willReturn(new Tag($newName));
|
||||||
|
|
||||||
$this->commandTester->execute([
|
$this->commandTester->execute([
|
||||||
|
|
|
@ -6,7 +6,6 @@ namespace ShlinkioTest\Shlink\Core\Action;
|
||||||
use finfo;
|
use finfo;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Argument;
|
use Prophecy\Argument;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
|
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
|
||||||
|
@ -76,7 +75,6 @@ class PreviewActionTest extends TestCase
|
||||||
$this->urlShortener->shortCodeToUrl($shortCode)->willThrow(InvalidShortCodeException::class)
|
$this->urlShortener->shortCodeToUrl($shortCode)->willThrow(InvalidShortCodeException::class)
|
||||||
->shouldBeCalledOnce();
|
->shouldBeCalledOnce();
|
||||||
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
||||||
/** @var MethodProphecy $process */
|
|
||||||
$process = $delegate->handle(Argument::any())->willReturn(new Response());
|
$process = $delegate->handle(Argument::any())->willReturn(new Response());
|
||||||
|
|
||||||
$this->action->process(
|
$this->action->process(
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace ShlinkioTest\Shlink\Core\Action;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Argument;
|
use Prophecy\Argument;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
|
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
|
||||||
|
@ -56,7 +55,6 @@ class QrCodeActionTest extends TestCase
|
||||||
$this->urlShortener->shortCodeToUrl($shortCode)->willThrow(InvalidShortCodeException::class)
|
$this->urlShortener->shortCodeToUrl($shortCode)->willThrow(InvalidShortCodeException::class)
|
||||||
->shouldBeCalledOnce();
|
->shouldBeCalledOnce();
|
||||||
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
||||||
/** @var MethodProphecy $process */
|
|
||||||
$process = $delegate->handle(Argument::any())->willReturn(new Response());
|
$process = $delegate->handle(Argument::any())->willReturn(new Response());
|
||||||
|
|
||||||
$this->action->process((new ServerRequest())->withAttribute('shortCode', $shortCode), $delegate->reveal());
|
$this->action->process((new ServerRequest())->withAttribute('shortCode', $shortCode), $delegate->reveal());
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Argument;
|
use Prophecy\Argument;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||||
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
|
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
|
||||||
|
@ -33,9 +32,7 @@ class TagServiceTest extends TestCase
|
||||||
$expected = [new Tag('foo'), new Tag('bar')];
|
$expected = [new Tag('foo'), new Tag('bar')];
|
||||||
|
|
||||||
$repo = $this->prophesize(EntityRepository::class);
|
$repo = $this->prophesize(EntityRepository::class);
|
||||||
/** @var MethodProphecy $find */
|
|
||||||
$find = $repo->findBy(Argument::cetera())->willReturn($expected);
|
$find = $repo->findBy(Argument::cetera())->willReturn($expected);
|
||||||
/** @var MethodProphecy $getRepo */
|
|
||||||
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
||||||
|
|
||||||
$result = $this->service->listTags();
|
$result = $this->service->listTags();
|
||||||
|
@ -49,9 +46,7 @@ class TagServiceTest extends TestCase
|
||||||
public function deleteTagsDelegatesOnRepository()
|
public function deleteTagsDelegatesOnRepository()
|
||||||
{
|
{
|
||||||
$repo = $this->prophesize(TagRepository::class);
|
$repo = $this->prophesize(TagRepository::class);
|
||||||
/** @var MethodProphecy $delete */
|
|
||||||
$delete = $repo->deleteByName(['foo', 'bar'])->willReturn(4);
|
$delete = $repo->deleteByName(['foo', 'bar'])->willReturn(4);
|
||||||
/** @var MethodProphecy $getRepo */
|
|
||||||
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
||||||
|
|
||||||
$this->service->deleteTags(['foo', 'bar']);
|
$this->service->deleteTags(['foo', 'bar']);
|
||||||
|
@ -64,13 +59,9 @@ class TagServiceTest extends TestCase
|
||||||
public function createTagsPersistsEntities()
|
public function createTagsPersistsEntities()
|
||||||
{
|
{
|
||||||
$repo = $this->prophesize(TagRepository::class);
|
$repo = $this->prophesize(TagRepository::class);
|
||||||
/** @var MethodProphecy $find */
|
|
||||||
$find = $repo->findOneBy(Argument::cetera())->willReturn(new Tag('foo'));
|
$find = $repo->findOneBy(Argument::cetera())->willReturn(new Tag('foo'));
|
||||||
/** @var MethodProphecy $getRepo */
|
|
||||||
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
||||||
/** @var MethodProphecy $persist */
|
|
||||||
$persist = $this->em->persist(Argument::type(Tag::class))->willReturn(null);
|
$persist = $this->em->persist(Argument::type(Tag::class))->willReturn(null);
|
||||||
/** @var MethodProphecy $flush */
|
|
||||||
$flush = $this->em->flush()->willReturn(null);
|
$flush = $this->em->flush()->willReturn(null);
|
||||||
|
|
||||||
$result = $this->service->createTags(['foo', 'bar']);
|
$result = $this->service->createTags(['foo', 'bar']);
|
||||||
|
@ -86,9 +77,7 @@ class TagServiceTest extends TestCase
|
||||||
public function renameInvalidTagThrowsException()
|
public function renameInvalidTagThrowsException()
|
||||||
{
|
{
|
||||||
$repo = $this->prophesize(TagRepository::class);
|
$repo = $this->prophesize(TagRepository::class);
|
||||||
/** @var MethodProphecy $find */
|
|
||||||
$find = $repo->findOneBy(Argument::cetera())->willReturn(null);
|
$find = $repo->findOneBy(Argument::cetera())->willReturn(null);
|
||||||
/** @var MethodProphecy $getRepo */
|
|
||||||
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
||||||
|
|
||||||
$find->shouldBeCalled();
|
$find->shouldBeCalled();
|
||||||
|
@ -104,11 +93,8 @@ class TagServiceTest extends TestCase
|
||||||
$expected = new Tag('foo');
|
$expected = new Tag('foo');
|
||||||
|
|
||||||
$repo = $this->prophesize(TagRepository::class);
|
$repo = $this->prophesize(TagRepository::class);
|
||||||
/** @var MethodProphecy $find */
|
|
||||||
$find = $repo->findOneBy(Argument::cetera())->willReturn($expected);
|
$find = $repo->findOneBy(Argument::cetera())->willReturn($expected);
|
||||||
/** @var MethodProphecy $getRepo */
|
|
||||||
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
|
||||||
/** @var MethodProphecy $flush */
|
|
||||||
$flush = $this->em->flush($expected)->willReturn(null);
|
$flush = $this->em->flush($expected)->willReturn(null);
|
||||||
|
|
||||||
$tag = $this->service->renameTag('foo', 'bar');
|
$tag = $this->service->renameTag('foo', 'bar');
|
||||||
|
|
|
@ -13,7 +13,6 @@ use GuzzleHttp\Exception\ClientException;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Argument;
|
use Prophecy\Argument;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\Core\Entity\ShortUrl;
|
use Shlinkio\Shlink\Core\Entity\ShortUrl;
|
||||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||||
|
@ -123,7 +122,6 @@ class UrlShortenerTest extends TestCase
|
||||||
$repo = $this->prophesize(ShortUrlRepository::class);
|
$repo = $this->prophesize(ShortUrlRepository::class);
|
||||||
$countBySlug = $repo->count(['shortCode' => 'custom-slug'])->willReturn(1);
|
$countBySlug = $repo->count(['shortCode' => 'custom-slug'])->willReturn(1);
|
||||||
$repo->findOneBy(Argument::cetera())->willReturn(null);
|
$repo->findOneBy(Argument::cetera())->willReturn(null);
|
||||||
/** @var MethodProphecy $getRepo */
|
|
||||||
$getRepo = $this->em->getRepository(ShortUrl::class)->willReturn($repo->reveal());
|
$getRepo = $this->em->getRepository(ShortUrl::class)->willReturn($repo->reveal());
|
||||||
|
|
||||||
$countBySlug->shouldBeCalledOnce();
|
$countBySlug->shouldBeCalledOnce();
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
|
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
use Shlinkio\Shlink\Rest\Action\Tag\DeleteTagsAction;
|
use Shlinkio\Shlink\Rest\Action\Tag\DeleteTagsAction;
|
||||||
|
@ -30,7 +29,6 @@ class DeleteTagsActionTest extends TestCase
|
||||||
public function processDelegatesIntoService(?array $tags): void
|
public function processDelegatesIntoService(?array $tags): void
|
||||||
{
|
{
|
||||||
$request = (new ServerRequest())->withQueryParams(['tags' => $tags]);
|
$request = (new ServerRequest())->withQueryParams(['tags' => $tags]);
|
||||||
/** @var MethodProphecy $deleteTags */
|
|
||||||
$deleteTags = $this->tagService->deleteTags($tags ?: []);
|
$deleteTags = $this->tagService->deleteTags($tags ?: []);
|
||||||
|
|
||||||
$response = $this->action->handle($request);
|
$response = $this->action->handle($request);
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
|
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||||
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
|
||||||
|
@ -28,7 +27,6 @@ class ListTagsActionTest extends TestCase
|
||||||
/** @test */
|
/** @test */
|
||||||
public function returnsDataFromService()
|
public function returnsDataFromService()
|
||||||
{
|
{
|
||||||
/** @var MethodProphecy $listTags */
|
|
||||||
$listTags = $this->tagService->listTags()->willReturn([new Tag('foo'), new Tag('bar')]);
|
$listTags = $this->tagService->listTags()->willReturn([new Tag('foo'), new Tag('bar')]);
|
||||||
|
|
||||||
$resp = $this->action->handle(new ServerRequest());
|
$resp = $this->action->handle(new ServerRequest());
|
||||||
|
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
|
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Prophecy\Prophecy\ObjectProphecy;
|
use Prophecy\Prophecy\ObjectProphecy;
|
||||||
use Shlinkio\Shlink\Core\Entity\Tag;
|
use Shlinkio\Shlink\Core\Entity\Tag;
|
||||||
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
|
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
|
||||||
|
@ -51,7 +50,6 @@ class UpdateTagActionTest extends TestCase
|
||||||
'oldName' => 'foo',
|
'oldName' => 'foo',
|
||||||
'newName' => 'bar',
|
'newName' => 'bar',
|
||||||
]);
|
]);
|
||||||
/** @var MethodProphecy $rename */
|
|
||||||
$rename = $this->tagService->renameTag('foo', 'bar')->willThrow(EntityDoesNotExistException::class);
|
$rename = $this->tagService->renameTag('foo', 'bar')->willThrow(EntityDoesNotExistException::class);
|
||||||
|
|
||||||
$resp = $this->action->handle($request);
|
$resp = $this->action->handle($request);
|
||||||
|
@ -67,7 +65,6 @@ class UpdateTagActionTest extends TestCase
|
||||||
'oldName' => 'foo',
|
'oldName' => 'foo',
|
||||||
'newName' => 'bar',
|
'newName' => 'bar',
|
||||||
]);
|
]);
|
||||||
/** @var MethodProphecy $rename */
|
|
||||||
$rename = $this->tagService->renameTag('foo', 'bar')->willReturn(new Tag('bar'));
|
$rename = $this->tagService->renameTag('foo', 'bar')->willReturn(new Tag('bar'));
|
||||||
|
|
||||||
$resp = $this->action->handle($request);
|
$resp = $this->action->handle($request);
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace ShlinkioTest\Shlink\Rest\Middleware;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\Argument;
|
use Prophecy\Argument;
|
||||||
use Prophecy\Prophecy\MethodProphecy;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware;
|
use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware;
|
||||||
|
@ -68,7 +67,6 @@ class BodyParserMiddlewareTest extends TestCase
|
||||||
->withBody($body)
|
->withBody($body)
|
||||||
->withHeader('content-type', 'application/json');
|
->withHeader('content-type', 'application/json');
|
||||||
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
||||||
/** @var MethodProphecy $process */
|
|
||||||
$process = $delegate->handle(Argument::type(ServerRequestInterface::class))->will(
|
$process = $delegate->handle(Argument::type(ServerRequestInterface::class))->will(
|
||||||
function (array $args) use ($test) {
|
function (array $args) use ($test) {
|
||||||
/** @var ServerRequestInterface $req */
|
/** @var ServerRequestInterface $req */
|
||||||
|
@ -97,7 +95,6 @@ class BodyParserMiddlewareTest extends TestCase
|
||||||
$request = (new ServerRequest())->withMethod('PUT')
|
$request = (new ServerRequest())->withMethod('PUT')
|
||||||
->withBody($body);
|
->withBody($body);
|
||||||
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
$delegate = $this->prophesize(RequestHandlerInterface::class);
|
||||||
/** @var MethodProphecy $process */
|
|
||||||
$process = $delegate->handle(Argument::type(ServerRequestInterface::class))->will(
|
$process = $delegate->handle(Argument::type(ServerRequestInterface::class))->will(
|
||||||
function (array $args) use ($test) {
|
function (array $args) use ($test) {
|
||||||
/** @var ServerRequestInterface $req */
|
/** @var ServerRequestInterface $req */
|
||||||
|
|
Loading…
Add table
Reference in a new issue