]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
Merge pull request #1583 from wallabag/v2-fix-delete
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Tests / Import / PocketImportTest.php
index cf706fa9490bb53bad0ea2585a142557b41d42e8..76225fe4f21be2b119f7b17b9c247a7e5f3d1dc4 100644 (file)
@@ -74,7 +74,8 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
         $pocketImport = $this->getPocketImport();
 
         $this->assertEquals('Pocket', $pocketImport->getName());
-        $this->assertEquals('This importer will import all your <a href="https://getpocket.com">Pocket</a> data.', $pocketImport->getDescription());
+        $this->assertNotEmpty($pocketImport->getUrl());
+        $this->assertContains('This importer will import all your Pocket data.', $pocketImport->getDescription());
     }
 
     public function testOAuthRequest()
@@ -247,7 +248,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
             ->getMock();
 
         $entryRepo->expects($this->exactly(2))
-            ->method('existByUrlAndUserId')
+            ->method('findByUrlAndUserId')
             ->will($this->onConsecutiveCalls(false, true));
 
         $tag = $this->getMockBuilder('Wallabag\CoreBundle\Entity\Tag')
@@ -259,7 +260,9 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
             ->getMock();
 
         $tagRepo->expects($this->exactly(2))
-            ->method('findOneByLabelAndUserId')
+            // the method `findOneByLabel` doesn't exist, EntityRepository will then call `_call` method
+            // to magically call the `findOneBy` with ['label' => 'foo']
+            ->method('__call')
             ->will($this->onConsecutiveCalls(false, $tag));
 
         $this->em