From e1d3813f8ef151d27eb346a4f69d60fb683ae316 Mon Sep 17 00:00:00 2001 From: Vincent Composieux Date: Fri, 14 Sep 2018 21:06:37 +0200 Subject: [PATCH] Fixed PHPUnit deprecations --- Tests/Feed/FeedManagerTest.php | 4 ++-- Tests/Feed/FeedTest.php | 4 ++-- Tests/Formatter/AtomFormatterTest.php | 8 ++++---- Tests/Formatter/RSSFormatterTest.php | 8 ++++---- Tests/Service/FeedDumpServiceTest.php | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Tests/Feed/FeedManagerTest.php b/Tests/Feed/FeedManagerTest.php index ec68e5b..2216e76 100644 --- a/Tests/Feed/FeedManagerTest.php +++ b/Tests/Feed/FeedManagerTest.php @@ -45,9 +45,9 @@ public function setUp() ], ]; - $router = $this->getMock('Symfony\Component\Routing\RouterInterface'); + $router = $this->createMock('Symfony\Component\Routing\RouterInterface'); - $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $translator = $this->createMock('Symfony\Component\Translation\TranslatorInterface'); $formatters = [ 'rss' => new RssFormatter($translator, 'test'), diff --git a/Tests/Feed/FeedTest.php b/Tests/Feed/FeedTest.php index 22e1cd1..ba2c0ef 100644 --- a/Tests/Feed/FeedTest.php +++ b/Tests/Feed/FeedTest.php @@ -46,9 +46,9 @@ public function setUp() ], ]; - $router = $this->getMock('Symfony\Component\Routing\RouterInterface'); + $router = $this->createMock('Symfony\Component\Routing\RouterInterface'); - $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $translator = $this->createMock('Symfony\Component\Translation\TranslatorInterface'); $formatters = [ 'rss' => new RssFormatter($translator, 'test'), diff --git a/Tests/Formatter/AtomFormatterTest.php b/Tests/Formatter/AtomFormatterTest.php index 6491f2d..d4d1fe6 100644 --- a/Tests/Formatter/AtomFormatterTest.php +++ b/Tests/Formatter/AtomFormatterTest.php @@ -53,7 +53,7 @@ public function setUp() ], ]; - $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $translator = $this->createMock('Symfony\Component\Translation\TranslatorInterface'); $formatters = [ 'rss' => new RssFormatter($translator, 'test'), @@ -81,7 +81,7 @@ public function testAuthorEmptyException() ], ]; - $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $translator = $this->createMock('Symfony\Component\Translation\TranslatorInterface'); $formatters = [ 'rss' => new RssFormatter($translator, 'test'), @@ -432,7 +432,7 @@ public function testTranslatableValue() ], ]; - $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $translator = $this->createMock('Symfony\Component\Translation\TranslatorInterface'); $translator->expects($this->any())->method('trans')->will($this->returnValue('translatable-value')); $formatters = ['atom' => new AtomFormatter($translator, 'test')]; @@ -456,7 +456,7 @@ public function testTranslatableValue() */ private function getMockRouter() { - $mockRouter = $this->getMock('Symfony\Component\Routing\RouterInterface'); + $mockRouter = $this->createMock('Symfony\Component\Routing\RouterInterface'); $mockRouter->expects($this->any()) ->method('generate') diff --git a/Tests/Formatter/RSSFormatterTest.php b/Tests/Formatter/RSSFormatterTest.php index af059f4..12240e4 100644 --- a/Tests/Formatter/RSSFormatterTest.php +++ b/Tests/Formatter/RSSFormatterTest.php @@ -53,14 +53,14 @@ public function setUp() ], ]; - $router = $this->getMock('Symfony\Component\Routing\RouterInterface'); + $router = $this->createMock('Symfony\Component\Routing\RouterInterface'); $router->expects($this->any()) ->method('generate') ->with('fake_route', [], UrlGeneratorInterface::ABSOLUTE_URL) ->will($this->returnValue('http://github.com/eko/FeedBundle/article/fake/url?utm_source=mysource&utm_medium=mymedium&utm_campaign=mycampaign&utm_content=mycontent')); - $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $translator = $this->createMock('Symfony\Component\Translation\TranslatorInterface'); $formatters = [ 'rss' => new RssFormatter($translator, 'test'), @@ -399,12 +399,12 @@ public function testTranslatableValue() ], ]; - $translator = $this->getMock('Symfony\Component\Translation\TranslatorInterface'); + $translator = $this->createMock('Symfony\Component\Translation\TranslatorInterface'); $translator->expects($this->any())->method('trans')->will($this->returnValue('translatable-value')); $formatters = ['rss' => new RssFormatter($translator, 'test')]; - $router = $this->getMock('Symfony\Component\Routing\RouterInterface'); + $router = $this->createMock('Symfony\Component\Routing\RouterInterface'); $manager = new FeedManager($router, $config, $formatters); diff --git a/Tests/Service/FeedDumpServiceTest.php b/Tests/Service/FeedDumpServiceTest.php index b88a2f1..993dd68 100644 --- a/Tests/Service/FeedDumpServiceTest.php +++ b/Tests/Service/FeedDumpServiceTest.php @@ -90,7 +90,7 @@ public function testDumpWithAnEntity() $this->service->setEntity('Eko\FeedBundle\Tests\Entity\Writer\FakeItemInterfaceEntity'); $this->service->setDirection('ASC'); - $entity = $this->getMock('Eko\FeedBundle\Tests\Entity\Writer\FakeItemInterfaceEntity'); + $entity = $this->createMock('Eko\FeedBundle\Tests\Entity\Writer\FakeItemInterfaceEntity'); $repository = $this->getMockBuilder('Doctrine\ORM\EntityRepository') ->disableOriginalConstructor()