]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Use Psr\Log\NullLogger instead of creating a mock
authorKévin Gomez <contact@kevingomez.fr>
Sat, 31 Oct 2015 15:38:49 +0000 (16:38 +0100)
committerKévin Gomez <contact@kevingomez.fr>
Wed, 11 Nov 2015 15:27:53 +0000 (16:27 +0100)
src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php

index f59edb0c9746ff55d7f122df4c3529f252defbc6..ef7cbd5b2a8c974362f852f7fc77196c932fd3fc 100644 (file)
@@ -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();
     }
 }