aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/ImportBundle')
-rw-r--r--tests/Wallabag/ImportBundle/Import/PocketImportTest.php28
1 files changed, 3 insertions, 25 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
index 5bf47d96..d6b9617e 100644
--- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
@@ -27,32 +27,15 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
27 protected $em; 27 protected $em;
28 protected $contentProxy; 28 protected $contentProxy;
29 protected $logHandler; 29 protected $logHandler;
30 protected $producer;
31 30
32 private function getPocketImport($consumerKey = 'ConsumerKey', $rabbitMQ = false) 31 private function getPocketImport($consumerKey = 'ConsumerKey')
33 { 32 {
34 $this->user = new User(); 33 $this->user = new User();
35 34
36 $this->tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')
37 ->disableOriginalConstructor()
38 ->getMock();
39
40 $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')
41 ->disableOriginalConstructor()
42 ->getMock();
43
44 $this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy') 35 $this->contentProxy = $this->getMockBuilder('Wallabag\CoreBundle\Helper\ContentProxy')
45 ->disableOriginalConstructor() 36 ->disableOriginalConstructor()
46 ->getMock(); 37 ->getMock();
47 38
48 $token->expects($this->once())
49 ->method('getUser')
50 ->willReturn($this->user);
51
52 $this->tokenStorage->expects($this->once())
53 ->method('getToken')
54 ->willReturn($token);
55
56 $this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager') 39 $this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
57 ->disableOriginalConstructor() 40 ->disableOriginalConstructor()
58 ->getMock(); 41 ->getMock();
@@ -66,17 +49,12 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
66 ->with('pocket_consumer_key') 49 ->with('pocket_consumer_key')
67 ->willReturn($consumerKey); 50 ->willReturn($consumerKey);
68 51
69 $this->producer = $this->getMockBuilder('OldSound\RabbitMqBundle\RabbitMq\Producer')
70 ->disableOriginalConstructor()
71 ->getMock();
72
73 $pocket = new PocketImportMock( 52 $pocket = new PocketImportMock(
74 $this->tokenStorage,
75 $this->em, 53 $this->em,
76 $this->contentProxy, 54 $this->contentProxy,
77 $config, 55 $config
78 $this->producer
79 ); 56 );
57 $pocket->setUser($this->user);
80 58
81 $this->logHandler = new TestHandler(); 59 $this->logHandler = new TestHandler();
82 $logger = new Logger('test', [$this->logHandler]); 60 $logger = new Logger('test', [$this->logHandler]);