mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 01:21:03 +00:00
CS
This commit is contained in:
parent
0c00e52516
commit
eb570e49c8
3 changed files with 6 additions and 8 deletions
|
@ -110,6 +110,8 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
|
||||||
private $trusted;
|
private $trusted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @var ArrayCollection
|
||||||
|
*
|
||||||
* @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"})
|
* @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"})
|
||||||
*/
|
*/
|
||||||
protected $clients;
|
protected $clients;
|
||||||
|
@ -306,10 +308,8 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
|
||||||
*/
|
*/
|
||||||
public function getFirstClient()
|
public function getFirstClient()
|
||||||
{
|
{
|
||||||
if (empty($this->clients)) {
|
if (!empty($this->clients)) {
|
||||||
return $this->clients;
|
return $this->clients->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->clients->first();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
'text' => 'my annotation',
|
'text' => 'my annotation',
|
||||||
'quote' => 'my quote',
|
'quote' => 'my quote',
|
||||||
'ranges' => [
|
'ranges' => [
|
||||||
['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31]
|
['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content);
|
$this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content);
|
||||||
|
@ -130,7 +130,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
'text' => 'my annotation',
|
'text' => 'my annotation',
|
||||||
'quote' => $longQuote,
|
'quote' => $longQuote,
|
||||||
'ranges' => [
|
'ranges' => [
|
||||||
['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31]
|
['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content);
|
$this->client->request('POST', $prefixUrl.'/'.$entry->getId().'.json', [], [], $headers, $content);
|
||||||
|
|
|
@ -4,10 +4,8 @@ namespace Tests\Wallabag\CoreBundle\Command;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||||
use Symfony\Component\Console\Tester\CommandTester;
|
use Symfony\Component\Console\Tester\CommandTester;
|
||||||
use Wallabag\CoreBundle\Command\CleanDuplicatesCommand;
|
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
use Wallabag\CoreBundle\Command\ShowUserCommand;
|
use Wallabag\CoreBundle\Command\ShowUserCommand;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class ShowUserCommandTest extends WallabagCoreTestCase
|
class ShowUserCommandTest extends WallabagCoreTestCase
|
||||||
|
|
Loading…
Reference in a new issue