forked from wallabag/wallabag
Use ::class notation where possible
This commit is contained in:
@ -2,12 +2,19 @@
|
||||
|
||||
namespace Tests\Wallabag\ImportBundle\Import;
|
||||
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\UnitOfWork;
|
||||
use M6Web\Component\RedisMock\RedisMockFactory;
|
||||
use Monolog\Handler\TestHandler;
|
||||
use Monolog\Logger;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Predis\Client;
|
||||
use Simpleue\Queue\RedisQueue;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
use Wallabag\CoreBundle\Helper\TagsAssigner;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
||||
use Wallabag\ImportBundle\Redis\Producer;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
@ -35,7 +42,7 @@ class WallabagV2ImportTest extends TestCase
|
||||
$wallabagV2Import = $this->getWallabagV2Import(false, 2);
|
||||
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
$entryRepo = $this->getMockBuilder(EntryRepository::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@ -64,7 +71,7 @@ class WallabagV2ImportTest extends TestCase
|
||||
$wallabagV2Import = $this->getWallabagV2Import(false, 2);
|
||||
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2-read.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
$entryRepo = $this->getMockBuilder(EntryRepository::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@ -102,7 +109,7 @@ class WallabagV2ImportTest extends TestCase
|
||||
$wallabagV2Import = $this->getWallabagV2Import();
|
||||
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
$entryRepo = $this->getMockBuilder(EntryRepository::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@ -117,7 +124,7 @@ class WallabagV2ImportTest extends TestCase
|
||||
->expects($this->never())
|
||||
->method('updateEntry');
|
||||
|
||||
$producer = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\Producer')
|
||||
$producer = $this->getMockBuilder(\OldSound\RabbitMqBundle\RabbitMq\Producer::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@ -138,7 +145,7 @@ class WallabagV2ImportTest extends TestCase
|
||||
$wallabagV2Import = $this->getWallabagV2Import();
|
||||
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
$entryRepo = $this->getMockBuilder(EntryRepository::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@ -154,7 +161,7 @@ class WallabagV2ImportTest extends TestCase
|
||||
->method('updateEntry');
|
||||
|
||||
$factory = new RedisMockFactory();
|
||||
$redisMock = $factory->getAdapter('Predis\Client', true);
|
||||
$redisMock = $factory->getAdapter(Client::class, true);
|
||||
|
||||
$queue = new RedisQueue($redisMock, 'wallabag_v2');
|
||||
$producer = new Producer($queue);
|
||||
@ -213,7 +220,7 @@ class WallabagV2ImportTest extends TestCase
|
||||
$wallabagV2Import = $this->getWallabagV2Import(false, 2);
|
||||
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
$entryRepo = $this->getMockBuilder(EntryRepository::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@ -241,11 +248,11 @@ class WallabagV2ImportTest extends TestCase
|
||||
{
|
||||
$this->user = new User();
|
||||
|
||||
$this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
|
||||
$this->em = $this->getMockBuilder(EntityManager::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->uow = $this->getMockBuilder('Doctrine\ORM\UnitOfWork')
|
||||
$this->uow = $this->getMockBuilder(UnitOfWork::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
@ -259,15 +266,15 @@ class WallabagV2ImportTest extends TestCase
|
||||
->method('getScheduledEntityInsertions')
|
||||
->willReturn([]);
|
||||
|
||||
$this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy')
|
||||
$this->contentProxy = $this->getMockBuilder(ContentProxy::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->tagsAssigner = $this->getMockBuilder('Wallabag\CoreBundle\Helper\TagsAssigner')
|
||||
$this->tagsAssigner = $this->getMockBuilder(TagsAssigner::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher')
|
||||
$dispatcher = $this->getMockBuilder(EventDispatcher::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user