mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-11 09:25:25 +00:00
Fix some tests
This commit is contained in:
parent
b840268711
commit
c3396c65ef
1 changed files with 26 additions and 13 deletions
|
@ -3,6 +3,8 @@
|
|||
namespace Tests\Wallabag\CoreBundle\Controller;
|
||||
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class ConfigControllerTest extends WallabagCoreTestCase
|
||||
{
|
||||
|
@ -583,12 +585,6 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||
|
||||
$user = $em
|
||||
->getRepository('WallabagUserBundle:User')
|
||||
->findOneByUsername('wallace');
|
||||
$user->setExpired(1);
|
||||
$em->persist($user);
|
||||
|
||||
$user = $em
|
||||
->getRepository('WallabagUserBundle:User')
|
||||
->findOneByUsername('empty');
|
||||
|
@ -611,12 +607,6 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||
$client->request('GET', '/account/delete');
|
||||
$this->assertEquals(403, $client->getResponse()->getStatusCode());
|
||||
|
||||
$user = $em
|
||||
->getRepository('WallabagUserBundle:User')
|
||||
->findOneByUsername('wallace');
|
||||
$user->setExpired(0);
|
||||
$em->persist($user);
|
||||
|
||||
$user = $em
|
||||
->getRepository('WallabagUserBundle:User')
|
||||
->findOneByUsername('empty');
|
||||
|
@ -634,8 +624,31 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||
|
||||
public function testDeleteAccount()
|
||||
{
|
||||
$this->logInAs('wallace');
|
||||
$client = $this->getClient();
|
||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||
|
||||
$user = new User();
|
||||
$user->setName('Wallace');
|
||||
$user->setEmail('wallace@wallabag.org');
|
||||
$user->setUsername('wallace');
|
||||
$user->setPlainPassword('wallace');
|
||||
$user->setEnabled(true);
|
||||
$user->addRole('ROLE_SUPER_ADMIN');
|
||||
|
||||
$em->persist($user);
|
||||
|
||||
$config = new Config($user);
|
||||
|
||||
$config->setTheme('material');
|
||||
$config->setItemsPerPage(30);
|
||||
$config->setReadingSpeed(1);
|
||||
$config->setLanguage('en');
|
||||
$config->setPocketConsumerKey('xxxxx');
|
||||
|
||||
$em->persist($config);
|
||||
$em->flush();
|
||||
|
||||
$this->logInAs('wallace');
|
||||
|
||||
// create entry to check after user deletion
|
||||
// that this entry is also deleted
|
||||
|
|
Loading…
Reference in a new issue