Removed uneeded inline type hints

This commit is contained in:
Alejandro Celaya 2019-02-17 20:32:18 +01:00
parent 687a1cc9c7
commit 38cc83a4ee
12 changed files with 0 additions and 40 deletions

View file

@ -5,7 +5,6 @@ namespace ShlinkioTest\Shlink\CLI\Command\Tag;
use Doctrine\Common\Collections\ArrayCollection;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Tag\CreateTagCommand;
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
@ -43,7 +42,6 @@ class CreateTagCommandTest extends TestCase
public function serviceIsInvokedOnSuccess()
{
$tagNames = ['foo', 'bar'];
/** @var MethodProphecy $createTags */
$createTags = $this->tagService->createTags($tagNames)->willReturn(new ArrayCollection());
$this->commandTester->execute([

View file

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Tag\DeleteTagsCommand;
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
@ -44,7 +43,6 @@ class DeleteTagsCommandTest extends TestCase
public function serviceIsInvokedOnSuccess()
{
$tagNames = ['foo', 'bar'];
/** @var MethodProphecy $deleteTags */
$deleteTags = $this->tagService->deleteTags($tagNames)->will(function () {
});

View file

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Tag\ListTagsCommand;
use Shlinkio\Shlink\Core\Entity\Tag;
@ -35,7 +34,6 @@ class ListTagsCommandTest extends TestCase
/** @test */
public function noTagsPrintsEmptyMessage()
{
/** @var MethodProphecy $listTags */
$listTags = $this->tagService->listTags()->willReturn([]);
$this->commandTester->execute([]);
@ -48,7 +46,6 @@ class ListTagsCommandTest extends TestCase
/** @test */
public function listOfTagsIsPrinted()
{
/** @var MethodProphecy $listTags */
$listTags = $this->tagService->listTags()->willReturn([
new Tag('foo'),
new Tag('bar'),

View file

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace ShlinkioTest\Shlink\CLI\Command\Tag;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\CLI\Command\Tag\RenameTagCommand;
use Shlinkio\Shlink\Core\Entity\Tag;
@ -38,7 +37,6 @@ class RenameTagCommandTest extends TestCase
{
$oldName = 'foo';
$newName = 'bar';
/** @var MethodProphecy $renameTag */
$renameTag = $this->tagService->renameTag($oldName, $newName)->willThrow(EntityDoesNotExistException::class);
$this->commandTester->execute([
@ -56,7 +54,6 @@ class RenameTagCommandTest extends TestCase
{
$oldName = 'foo';
$newName = 'bar';
/** @var MethodProphecy $renameTag */
$renameTag = $this->tagService->renameTag($oldName, $newName)->willReturn(new Tag($newName));
$this->commandTester->execute([

View file

@ -6,7 +6,6 @@ namespace ShlinkioTest\Shlink\Core\Action;
use finfo;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Http\Server\RequestHandlerInterface;
use Shlinkio\Shlink\Common\Service\PreviewGenerator;
@ -76,7 +75,6 @@ class PreviewActionTest extends TestCase
$this->urlShortener->shortCodeToUrl($shortCode)->willThrow(InvalidShortCodeException::class)
->shouldBeCalledOnce();
$delegate = $this->prophesize(RequestHandlerInterface::class);
/** @var MethodProphecy $process */
$process = $delegate->handle(Argument::any())->willReturn(new Response());
$this->action->process(

View file

@ -5,7 +5,6 @@ namespace ShlinkioTest\Shlink\Core\Action;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Http\Server\RequestHandlerInterface;
use Shlinkio\Shlink\Common\Response\QrCodeResponse;
@ -56,7 +55,6 @@ class QrCodeActionTest extends TestCase
$this->urlShortener->shortCodeToUrl($shortCode)->willThrow(InvalidShortCodeException::class)
->shouldBeCalledOnce();
$delegate = $this->prophesize(RequestHandlerInterface::class);
/** @var MethodProphecy $process */
$process = $delegate->handle(Argument::any())->willReturn(new Response());
$this->action->process((new ServerRequest())->withAttribute('shortCode', $shortCode), $delegate->reveal());

View file

@ -7,7 +7,6 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Core\Entity\Tag;
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
@ -33,9 +32,7 @@ class TagServiceTest extends TestCase
$expected = [new Tag('foo'), new Tag('bar')];
$repo = $this->prophesize(EntityRepository::class);
/** @var MethodProphecy $find */
$find = $repo->findBy(Argument::cetera())->willReturn($expected);
/** @var MethodProphecy $getRepo */
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
$result = $this->service->listTags();
@ -49,9 +46,7 @@ class TagServiceTest extends TestCase
public function deleteTagsDelegatesOnRepository()
{
$repo = $this->prophesize(TagRepository::class);
/** @var MethodProphecy $delete */
$delete = $repo->deleteByName(['foo', 'bar'])->willReturn(4);
/** @var MethodProphecy $getRepo */
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
$this->service->deleteTags(['foo', 'bar']);
@ -64,13 +59,9 @@ class TagServiceTest extends TestCase
public function createTagsPersistsEntities()
{
$repo = $this->prophesize(TagRepository::class);
/** @var MethodProphecy $find */
$find = $repo->findOneBy(Argument::cetera())->willReturn(new Tag('foo'));
/** @var MethodProphecy $getRepo */
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
/** @var MethodProphecy $persist */
$persist = $this->em->persist(Argument::type(Tag::class))->willReturn(null);
/** @var MethodProphecy $flush */
$flush = $this->em->flush()->willReturn(null);
$result = $this->service->createTags(['foo', 'bar']);
@ -86,9 +77,7 @@ class TagServiceTest extends TestCase
public function renameInvalidTagThrowsException()
{
$repo = $this->prophesize(TagRepository::class);
/** @var MethodProphecy $find */
$find = $repo->findOneBy(Argument::cetera())->willReturn(null);
/** @var MethodProphecy $getRepo */
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
$find->shouldBeCalled();
@ -104,11 +93,8 @@ class TagServiceTest extends TestCase
$expected = new Tag('foo');
$repo = $this->prophesize(TagRepository::class);
/** @var MethodProphecy $find */
$find = $repo->findOneBy(Argument::cetera())->willReturn($expected);
/** @var MethodProphecy $getRepo */
$getRepo = $this->em->getRepository(Tag::class)->willReturn($repo->reveal());
/** @var MethodProphecy $flush */
$flush = $this->em->flush($expected)->willReturn(null);
$tag = $this->service->renameTag('foo', 'bar');

View file

@ -13,7 +13,6 @@ use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Psr7\Request;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Entity\Tag;
@ -123,7 +122,6 @@ class UrlShortenerTest extends TestCase
$repo = $this->prophesize(ShortUrlRepository::class);
$countBySlug = $repo->count(['shortCode' => 'custom-slug'])->willReturn(1);
$repo->findOneBy(Argument::cetera())->willReturn(null);
/** @var MethodProphecy $getRepo */
$getRepo = $this->em->getRepository(ShortUrl::class)->willReturn($repo->reveal());
$countBySlug->shouldBeCalledOnce();

View file

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
use Shlinkio\Shlink\Rest\Action\Tag\DeleteTagsAction;
@ -30,7 +29,6 @@ class DeleteTagsActionTest extends TestCase
public function processDelegatesIntoService(?array $tags): void
{
$request = (new ServerRequest())->withQueryParams(['tags' => $tags]);
/** @var MethodProphecy $deleteTags */
$deleteTags = $this->tagService->deleteTags($tags ?: []);
$response = $this->action->handle($request);

View file

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Core\Entity\Tag;
use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
@ -28,7 +27,6 @@ class ListTagsActionTest extends TestCase
/** @test */
public function returnsDataFromService()
{
/** @var MethodProphecy $listTags */
$listTags = $this->tagService->listTags()->willReturn([new Tag('foo'), new Tag('bar')]);
$resp = $this->action->handle(new ServerRequest());

View file

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace ShlinkioTest\Shlink\Rest\Action\Tag;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\MethodProphecy;
use Prophecy\Prophecy\ObjectProphecy;
use Shlinkio\Shlink\Core\Entity\Tag;
use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
@ -51,7 +50,6 @@ class UpdateTagActionTest extends TestCase
'oldName' => 'foo',
'newName' => 'bar',
]);
/** @var MethodProphecy $rename */
$rename = $this->tagService->renameTag('foo', 'bar')->willThrow(EntityDoesNotExistException::class);
$resp = $this->action->handle($request);
@ -67,7 +65,6 @@ class UpdateTagActionTest extends TestCase
'oldName' => 'foo',
'newName' => 'bar',
]);
/** @var MethodProphecy $rename */
$rename = $this->tagService->renameTag('foo', 'bar')->willReturn(new Tag('bar'));
$resp = $this->action->handle($request);

View file

@ -5,7 +5,6 @@ namespace ShlinkioTest\Shlink\Rest\Middleware;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\MethodProphecy;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware;
@ -68,7 +67,6 @@ class BodyParserMiddlewareTest extends TestCase
->withBody($body)
->withHeader('content-type', 'application/json');
$delegate = $this->prophesize(RequestHandlerInterface::class);
/** @var MethodProphecy $process */
$process = $delegate->handle(Argument::type(ServerRequestInterface::class))->will(
function (array $args) use ($test) {
/** @var ServerRequestInterface $req */
@ -97,7 +95,6 @@ class BodyParserMiddlewareTest extends TestCase
$request = (new ServerRequest())->withMethod('PUT')
->withBody($body);
$delegate = $this->prophesize(RequestHandlerInterface::class);
/** @var MethodProphecy $process */
$process = $delegate->handle(Argument::type(ServerRequestInterface::class))->will(
function (array $args) use ($test) {
/** @var ServerRequestInterface $req */