From: Kévin Gomez Date: Sat, 31 Oct 2015 15:38:49 +0000 (+0100) Subject: Use Psr\Log\NullLogger instead of creating a mock X-Git-Tag: 2.0.0-alpha.1~11^2~10 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=0c5bcd82bafbc91820857f7647186431273bc483;p=github%2Fwallabag%2Fwallabag.git Use Psr\Log\NullLogger instead of creating a mock --- 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 @@ namespace Wallabag\CoreBundle\Tests\Helper; +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use Psr\Log\NullLogger; + use Wallabag\CoreBundle\Entity\Entry; use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Helper\ContentProxy; @@ -29,7 +32,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase 'language' => '', )); - $proxy = new ContentProxy($graby, $tagger, $this->getLoggerMock()); + $proxy = new ContentProxy($graby, $tagger, $this->getLogger()); $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); $this->assertEquals('http://0.0.0.0', $entry->getUrl()); @@ -67,7 +70,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase ), )); - $proxy = new ContentProxy($graby, $tagger, $this->getLoggerMock()); + $proxy = new ContentProxy($graby, $tagger, $this->getLogger()); $entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io'); $this->assertEquals('http://domain.io', $entry->getUrl()); @@ -106,7 +109,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase ), )); - $proxy = new ContentProxy($graby, $tagger, $this->getLoggerMock()); + $proxy = new ContentProxy($graby, $tagger, $this->getLogger()); $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); $this->assertEquals('http://1.1.1.1', $entry->getUrl()); @@ -127,8 +130,8 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase ->getMock(); } - private function getLoggerMock() + private function getLogger() { - return $this->getMock('Psr\Log\LoggerInterface'); + return new NullLogger(); } }