aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Import
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-09-11 18:19:41 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-09-11 21:58:57 +0200
commit7230e4c39f84e5aca97f439953adfd265b8d9ba4 (patch)
tree945cbd85d8724454780c6795279da08c7845fa62 /tests/Wallabag/ImportBundle/Import
parentb3437d58ae224121375c99e9288d8b808524e624 (diff)
downloadwallabag-7230e4c39f84e5aca97f439953adfd265b8d9ba4.tar.gz
wallabag-7230e4c39f84e5aca97f439953adfd265b8d9ba4.tar.zst
wallabag-7230e4c39f84e5aca97f439953adfd265b8d9ba4.zip
Enable Redis on Travis
Add generated files from `composer up` Add more articles for Readability tests
Diffstat (limited to 'tests/Wallabag/ImportBundle/Import')
-rw-r--r--tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php b/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php
index 0981eedb..67917154 100644
--- a/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/ReadabilityImportTest.php
@@ -61,9 +61,9 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
61 ->disableOriginalConstructor() 61 ->disableOriginalConstructor()
62 ->getMock(); 62 ->getMock();
63 63
64 $entryRepo->expects($this->exactly(2)) 64 $entryRepo->expects($this->exactly(24))
65 ->method('findByUrlAndUserId') 65 ->method('findByUrlAndUserId')
66 ->will($this->onConsecutiveCalls(false, true)); 66 ->willReturn(false);
67 67
68 $this->em 68 $this->em
69 ->expects($this->any()) 69 ->expects($this->any())
@@ -75,14 +75,14 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
75 ->getMock(); 75 ->getMock();
76 76
77 $this->contentProxy 77 $this->contentProxy
78 ->expects($this->exactly(1)) 78 ->expects($this->exactly(24))
79 ->method('updateEntry') 79 ->method('updateEntry')
80 ->willReturn($entry); 80 ->willReturn($entry);
81 81
82 $res = $readabilityImport->import(); 82 $res = $readabilityImport->import();
83 83
84 $this->assertTrue($res); 84 $this->assertTrue($res);
85 $this->assertEquals(['skipped' => 1, 'imported' => 1], $readabilityImport->getSummary()); 85 $this->assertEquals(['skipped' => 0, 'imported' => 24], $readabilityImport->getSummary());
86 } 86 }
87 87
88 public function testImportAndMarkAllAsRead() 88 public function testImportAndMarkAllAsRead()
@@ -96,7 +96,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
96 96
97 $entryRepo->expects($this->exactly(2)) 97 $entryRepo->expects($this->exactly(2))
98 ->method('findByUrlAndUserId') 98 ->method('findByUrlAndUserId')
99 ->will($this->onConsecutiveCalls(false, false)); 99 ->will($this->onConsecutiveCalls(false, true));
100 100
101 $this->em 101 $this->em
102 ->expects($this->any()) 102 ->expects($this->any())
@@ -104,7 +104,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
104 ->willReturn($entryRepo); 104 ->willReturn($entryRepo);
105 105
106 $this->contentProxy 106 $this->contentProxy
107 ->expects($this->exactly(2)) 107 ->expects($this->exactly(1))
108 ->method('updateEntry') 108 ->method('updateEntry')
109 ->willReturn(new Entry($this->user)); 109 ->willReturn(new Entry($this->user));
110 110
@@ -120,7 +120,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
120 120
121 $this->assertTrue($res); 121 $this->assertTrue($res);
122 122
123 $this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary()); 123 $this->assertEquals(['skipped' => 1, 'imported' => 1], $readabilityImport->getSummary());
124 } 124 }
125 125
126 public function testImportWithRabbit() 126 public function testImportWithRabbit()
@@ -152,7 +152,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
152 ->getMock(); 152 ->getMock();
153 153
154 $producer 154 $producer
155 ->expects($this->exactly(2)) 155 ->expects($this->exactly(24))
156 ->method('publish'); 156 ->method('publish');
157 157
158 $readabilityImport->setProducer($producer); 158 $readabilityImport->setProducer($producer);
@@ -160,7 +160,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
160 $res = $readabilityImport->setMarkAsRead(true)->import(); 160 $res = $readabilityImport->setMarkAsRead(true)->import();
161 161
162 $this->assertTrue($res); 162 $this->assertTrue($res);
163 $this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary()); 163 $this->assertEquals(['skipped' => 0, 'imported' => 24], $readabilityImport->getSummary());
164 } 164 }
165 165
166 public function testImportWithRedis() 166 public function testImportWithRedis()
@@ -198,7 +198,7 @@ class ReadabilityImportTest extends \PHPUnit_Framework_TestCase
198 $res = $readabilityImport->setMarkAsRead(true)->import(); 198 $res = $readabilityImport->setMarkAsRead(true)->import();
199 199
200 $this->assertTrue($res); 200 $this->assertTrue($res);
201 $this->assertEquals(['skipped' => 0, 'imported' => 2], $readabilityImport->getSummary()); 201 $this->assertEquals(['skipped' => 0, 'imported' => 24], $readabilityImport->getSummary());
202 202
203 $this->assertNotEmpty($redisMock->lpop('readability')); 203 $this->assertNotEmpty($redisMock->lpop('readability'));
204 } 204 }