diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-07 23:23:34 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-07 23:31:14 +0200 |
commit | eb570e49c8e3ba12638fac600bb5527191c2aaa2 (patch) | |
tree | 305212af68db9c2b1882788c9218aa323b801b78 | |
parent | 0c00e5251671c3648eabb8888271c09137ad902d (diff) | |
download | wallabag-eb570e49c8e3ba12638fac600bb5527191c2aaa2.tar.gz wallabag-eb570e49c8e3ba12638fac600bb5527191c2aaa2.tar.zst wallabag-eb570e49c8e3ba12638fac600bb5527191c2aaa2.zip |
CS
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 | ||
5 | use Symfony\Bundle\FrameworkBundle\Console\Application; | 5 | use Symfony\Bundle\FrameworkBundle\Console\Application; |
6 | use Symfony\Component\Console\Tester\CommandTester; | 6 | use Symfony\Component\Console\Tester\CommandTester; |
7 | use Wallabag\CoreBundle\Command\CleanDuplicatesCommand; | ||
8 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | 7 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; |
9 | use Wallabag\CoreBundle\Command\ShowUserCommand; | 8 | use Wallabag\CoreBundle\Command\ShowUserCommand; |
10 | use Wallabag\CoreBundle\Entity\Entry; | ||
11 | use Wallabag\UserBundle\Entity\User; | 9 | use Wallabag\UserBundle\Entity\User; |
12 | 10 | ||
13 | class ShowUserCommandTest extends WallabagCoreTestCase | 11 | class ShowUserCommandTest extends WallabagCoreTestCase |