Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed PHPUnit deprecations
  • Loading branch information
eko committed Sep 14, 2018
1 parent 4938892 commit e1d3813
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Tests/Feed/FeedManagerTest.php
Expand Up @@ -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'),
Expand Down
4 changes: 2 additions & 2 deletions Tests/Feed/FeedTest.php
Expand Up @@ -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'),
Expand Down
8 changes: 4 additions & 4 deletions Tests/Formatter/AtomFormatterTest.php
Expand Up @@ -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'),
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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')];
Expand All @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions Tests/Formatter/RSSFormatterTest.php
Expand Up @@ -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'),
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion Tests/Service/FeedDumpServiceTest.php
Expand Up @@ -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()
Expand Down

0 comments on commit e1d3813

Please sign in to comment.