aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2015-12-08 09:20:03 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2015-12-08 09:20:03 +0100
commit347fa6beb0bd3fafd5f722c8ce2e2b3915e4e82e (patch)
tree23c7c5cee6aefbbf8ec058ac99f4729c7be4ac3e /src/Wallabag/CoreBundle/Tests
parentc5d0db8b71a8c1bb6b5c08763b44e14b4f876d06 (diff)
downloadwallabag-347fa6beb0bd3fafd5f722c8ce2e2b3915e4e82e.tar.gz
wallabag-347fa6beb0bd3fafd5f722c8ce2e2b3915e4e82e.tar.zst
wallabag-347fa6beb0bd3fafd5f722c8ce2e2b3915e4e82e.zip
php cs
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Form/DataTransformer/StringToListTransformerTest.php20
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php24
4 files changed, 23 insertions, 25 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php
index 739b2dec..aaa26499 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/ExportControllerTest.php
@@ -150,7 +150,7 @@ class ExportControllerTest extends WallabagCoreTestCase
150 150
151 $this->assertGreaterThan(1, $csv); 151 $this->assertGreaterThan(1, $csv);
152 // +1 for title line 152 // +1 for title line
153 $this->assertEquals(count($contentInDB)+1, count($csv)); 153 $this->assertEquals(count($contentInDB) + 1, count($csv));
154 $this->assertEquals('Title;URL;Content;Tags;"MIME Type";Language', $csv[0]); 154 $this->assertEquals('Title;URL;Content;Tags;"MIME Type";Language', $csv[0]);
155 } 155 }
156 156
diff --git a/src/Wallabag/CoreBundle/Tests/Form/DataTransformer/StringToListTransformerTest.php b/src/Wallabag/CoreBundle/Tests/Form/DataTransformer/StringToListTransformerTest.php
index d114e5f3..7105488d 100644
--- a/src/Wallabag/CoreBundle/Tests/Form/DataTransformer/StringToListTransformerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Form/DataTransformer/StringToListTransformerTest.php
@@ -19,10 +19,10 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
19 public function transformProvider() 19 public function transformProvider()
20 { 20 {
21 return array( 21 return array(
22 array( null, '' ), 22 array(null, ''),
23 array( array(), '' ), 23 array(array(), ''),
24 array( array('single value'), 'single value' ), 24 array(array('single value'), 'single value'),
25 array( array('first value', 'second value'), 'first value,second value' ), 25 array(array('first value', 'second value'), 'first value,second value'),
26 ); 26 );
27 } 27 }
28 28
@@ -39,12 +39,12 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
39 public function reverseTransformProvider() 39 public function reverseTransformProvider()
40 { 40 {
41 return array( 41 return array(
42 array( null, null ), 42 array(null, null),
43 array( '', array() ), 43 array('', array()),
44 array( 'single value', array('single value') ), 44 array('single value', array('single value')),
45 array( 'first value,second value', array('first value', 'second value') ), 45 array('first value,second value', array('first value', 'second value')),
46 array( 'first value, second value', array('first value', 'second value') ), 46 array('first value, second value', array('first value', 'second value')),
47 array( 'first value, , second value', array('first value', 'second value') ), 47 array('first value, , second value', array('first value', 'second value')),
48 ); 48 );
49 } 49 }
50} 50}
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
index ef7cbd5b..ac518dbb 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
@@ -2,9 +2,7 @@
2 2
3namespace Wallabag\CoreBundle\Tests\Helper; 3namespace Wallabag\CoreBundle\Tests\Helper;
4 4
5use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6use Psr\Log\NullLogger; 5use Psr\Log\NullLogger;
7
8use Wallabag\CoreBundle\Entity\Entry; 6use Wallabag\CoreBundle\Entity\Entry;
9use Wallabag\UserBundle\Entity\User; 7use Wallabag\UserBundle\Entity\User;
10use Wallabag\CoreBundle\Helper\ContentProxy; 8use Wallabag\CoreBundle\Helper\ContentProxy;
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
index 5180f7dd..37e137bf 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/RuleBasedTaggerTest.php
@@ -18,8 +18,8 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
18 18
19 public function setUp() 19 public function setUp()
20 { 20 {
21 $this->rulerz = $this->getRulerZMock(); 21 $this->rulerz = $this->getRulerZMock();
22 $this->tagRepository = $this->getTagRepositoryMock(); 22 $this->tagRepository = $this->getTagRepositoryMock();
23 $this->entryRepository = $this->getEntryRepositoryMock(); 23 $this->entryRepository = $this->getEntryRepositoryMock();
24 24
25 $this->tagger = new RuleBasedTagger($this->rulerz, $this->tagRepository, $this->entryRepository); 25 $this->tagger = new RuleBasedTagger($this->rulerz, $this->tagRepository, $this->entryRepository);
@@ -37,8 +37,8 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
37 public function testTagWithNoMatchingRule() 37 public function testTagWithNoMatchingRule()
38 { 38 {
39 $taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar')); 39 $taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar'));
40 $user = $this->getUser([$taggingRule]); 40 $user = $this->getUser([$taggingRule]);
41 $entry = new Entry($user); 41 $entry = new Entry($user);
42 42
43 $this->rulerz 43 $this->rulerz
44 ->expects($this->once()) 44 ->expects($this->once())
@@ -54,8 +54,8 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
54 public function testTagWithAMatchingRule() 54 public function testTagWithAMatchingRule()
55 { 55 {
56 $taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar')); 56 $taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar'));
57 $user = $this->getUser([$taggingRule]); 57 $user = $this->getUser([$taggingRule]);
58 $entry = new Entry($user); 58 $entry = new Entry($user);
59 59
60 $this->rulerz 60 $this->rulerz
61 ->expects($this->once()) 61 ->expects($this->once())
@@ -76,10 +76,10 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
76 76
77 public function testTagWithAMixOfMatchingRules() 77 public function testTagWithAMixOfMatchingRules()
78 { 78 {
79 $taggingRule = $this->getTaggingRule('bla bla', array('hey')); 79 $taggingRule = $this->getTaggingRule('bla bla', array('hey'));
80 $otherTaggingRule = $this->getTaggingRule('rule as string', array('foo')); 80 $otherTaggingRule = $this->getTaggingRule('rule as string', array('foo'));
81 81
82 $user = $this->getUser([$taggingRule, $otherTaggingRule]); 82 $user = $this->getUser([$taggingRule, $otherTaggingRule]);
83 $entry = new Entry($user); 83 $entry = new Entry($user);
84 84
85 $this->rulerz 85 $this->rulerz
@@ -98,9 +98,9 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
98 public function testWhenTheTagExists() 98 public function testWhenTheTagExists()
99 { 99 {
100 $taggingRule = $this->getTaggingRule('rule as string', array('foo')); 100 $taggingRule = $this->getTaggingRule('rule as string', array('foo'));
101 $user = $this->getUser([$taggingRule]); 101 $user = $this->getUser([$taggingRule]);
102 $entry = new Entry($user); 102 $entry = new Entry($user);
103 $tag = new Tag($user); 103 $tag = new Tag($user);
104 104
105 $this->rulerz 105 $this->rulerz
106 ->expects($this->once()) 106 ->expects($this->once())
@@ -123,7 +123,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
123 123
124 private function getUser(array $taggingRules = []) 124 private function getUser(array $taggingRules = [])
125 { 125 {
126 $user = new User(); 126 $user = new User();
127 $config = new Config($user); 127 $config = new Config($user);
128 128
129 $user->setConfig($config); 129 $user->setConfig($config);