diff options
author | Kévin Gomez <contact@kevingomez.fr> | 2015-10-31 16:38:49 +0100 |
---|---|---|
committer | Kévin Gomez <contact@kevingomez.fr> | 2015-11-11 16:27:53 +0100 |
commit | 0c5bcd82bafbc91820857f7647186431273bc483 (patch) | |
tree | ecd2f31c9ea73710326d86693c4c3de9fe219a33 /src/Wallabag/CoreBundle | |
parent | 7b1648961d2a9770e801f414d297efe3aace07e8 (diff) | |
download | wallabag-0c5bcd82bafbc91820857f7647186431273bc483.tar.gz wallabag-0c5bcd82bafbc91820857f7647186431273bc483.tar.zst wallabag-0c5bcd82bafbc91820857f7647186431273bc483.zip |
Use Psr\Log\NullLogger instead of creating a mock
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php index f59edb0c..ef7cbd5b 100644 --- a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php +++ b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php | |||
@@ -2,6 +2,9 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Tests\Helper; | 3 | namespace Wallabag\CoreBundle\Tests\Helper; |
4 | 4 | ||
5 | use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
6 | use Psr\Log\NullLogger; | ||
7 | |||
5 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Wallabag\CoreBundle\Entity\Entry; |
6 | use Wallabag\UserBundle\Entity\User; | 9 | use Wallabag\UserBundle\Entity\User; |
7 | use Wallabag\CoreBundle\Helper\ContentProxy; | 10 | use Wallabag\CoreBundle\Helper\ContentProxy; |
@@ -29,7 +32,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
29 | 'language' => '', | 32 | 'language' => '', |
30 | )); | 33 | )); |
31 | 34 | ||
32 | $proxy = new ContentProxy($graby, $tagger, $this->getLoggerMock()); | 35 | $proxy = new ContentProxy($graby, $tagger, $this->getLogger()); |
33 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); | 36 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); |
34 | 37 | ||
35 | $this->assertEquals('http://0.0.0.0', $entry->getUrl()); | 38 | $this->assertEquals('http://0.0.0.0', $entry->getUrl()); |
@@ -67,7 +70,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
67 | ), | 70 | ), |
68 | )); | 71 | )); |
69 | 72 | ||
70 | $proxy = new ContentProxy($graby, $tagger, $this->getLoggerMock()); | 73 | $proxy = new ContentProxy($graby, $tagger, $this->getLogger()); |
71 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io'); | 74 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io'); |
72 | 75 | ||
73 | $this->assertEquals('http://domain.io', $entry->getUrl()); | 76 | $this->assertEquals('http://domain.io', $entry->getUrl()); |
@@ -106,7 +109,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
106 | ), | 109 | ), |
107 | )); | 110 | )); |
108 | 111 | ||
109 | $proxy = new ContentProxy($graby, $tagger, $this->getLoggerMock()); | 112 | $proxy = new ContentProxy($graby, $tagger, $this->getLogger()); |
110 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); | 113 | $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); |
111 | 114 | ||
112 | $this->assertEquals('http://1.1.1.1', $entry->getUrl()); | 115 | $this->assertEquals('http://1.1.1.1', $entry->getUrl()); |
@@ -127,8 +130,8 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase | |||
127 | ->getMock(); | 130 | ->getMock(); |
128 | } | 131 | } |
129 | 132 | ||
130 | private function getLoggerMock() | 133 | private function getLogger() |
131 | { | 134 | { |
132 | return $this->getMock('Psr\Log\LoggerInterface'); | 135 | return new NullLogger(); |
133 | } | 136 | } |
134 | } | 137 | } |