aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-06-07 23:23:34 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-06-07 23:31:14 +0200
commiteb570e49c8e3ba12638fac600bb5527191c2aaa2 (patch)
tree305212af68db9c2b1882788c9218aa323b801b78
parent0c00e5251671c3648eabb8888271c09137ad902d (diff)
downloadwallabag-eb570e49c8e3ba12638fac600bb5527191c2aaa2.tar.gz
wallabag-eb570e49c8e3ba12638fac600bb5527191c2aaa2.tar.zst
wallabag-eb570e49c8e3ba12638fac600bb5527191c2aaa2.zip
CS
-rw-r--r--src/Wallabag/UserBundle/Entity/User.php8
-rw-r--r--tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php4
-rw-r--r--tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php2
3 files changed, 6 insertions, 8 deletions
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php
index 5c75846f..aba76ca7 100644
--- a/src/Wallabag/UserBundle/Entity/User.php
+++ b/src/Wallabag/UserBundle/Entity/User.php
@@ -110,6 +110,8 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
110 private $trusted; 110 private $trusted;
111 111
112 /** 112 /**
113 * @var ArrayCollection
114 *
113 * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"}) 115 * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"})
114 */ 116 */
115 protected $clients; 117 protected $clients;
@@ -306,10 +308,8 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
306 */ 308 */
307 public function getFirstClient() 309 public function getFirstClient()
308 { 310 {
309 if (empty($this->clients)) { 311 if (!empty($this->clients)) {
310 return $this->clients; 312 return $this->clients->first();
311 } 313 }
312
313 return $this->clients->first();
314 } 314 }
315} 315}
diff --git a/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
index 8f87ccf3..3c94382c 100644
--- a/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
+++ b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
@@ -85,7 +85,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
85 'text' => 'my annotation', 85 'text' => 'my annotation',
86 'quote' => 'my quote', 86 'quote' => 'my quote',
87 'ranges' => [ 87 'ranges' => [
88 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31] 88 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
89 ], 89 ],
90 ]); 90 ]);
91 $this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content); 91 $this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content);
@@ -130,7 +130,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
130 'text' => 'my annotation', 130 'text' => 'my annotation',
131 'quote' => $longQuote, 131 'quote' => $longQuote,
132 'ranges' => [ 132 'ranges' => [
133 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31] 133 ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
134 ], 134 ],
135 ]); 135 ]);
136 $this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content); 136 $this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content);
diff --git a/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php b/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php
index 3b928d1e..c0a4acfa 100644
--- a/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php
+++ b/tests/Wallabag/CoreBundle/Command/ShowUserCommandTest.php
@@ -4,10 +4,8 @@ namespace Tests\Wallabag\CoreBundle\Command;
4 4
5use Symfony\Bundle\FrameworkBundle\Console\Application; 5use Symfony\Bundle\FrameworkBundle\Console\Application;
6use Symfony\Component\Console\Tester\CommandTester; 6use Symfony\Component\Console\Tester\CommandTester;
7use Wallabag\CoreBundle\Command\CleanDuplicatesCommand;
8use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; 7use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
9use Wallabag\CoreBundle\Command\ShowUserCommand; 8use Wallabag\CoreBundle\Command\ShowUserCommand;
10use Wallabag\CoreBundle\Entity\Entry;
11use Wallabag\UserBundle\Entity\User; 9use Wallabag\UserBundle\Entity\User;
12 10
13class ShowUserCommandTest extends WallabagCoreTestCase 11class ShowUserCommandTest extends WallabagCoreTestCase