mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-06 02:33:48 +01:00
Added a test to check if entries are also deleted
This commit is contained in:
parent
71254701b7
commit
b840268711
@ -637,6 +637,20 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||||||
$this->logInAs('wallace');
|
$this->logInAs('wallace');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
// create entry to check after user deletion
|
||||||
|
// that this entry is also deleted
|
||||||
|
$crawler = $client->request('GET', '/new');
|
||||||
|
|
||||||
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$form = $crawler->filter('form[name=entry]')->form();
|
||||||
|
$data = [
|
||||||
|
'entry[url]' => $url = 'https://github.com/wallabag/wallabag',
|
||||||
|
];
|
||||||
|
|
||||||
|
$client->submit($form, $data);
|
||||||
|
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/config');
|
$crawler = $client->request('GET', '/config');
|
||||||
|
|
||||||
$deleteLink = $crawler->filter('.delete-account')->last()->link();
|
$deleteLink = $crawler->filter('.delete-account')->last()->link();
|
||||||
@ -654,5 +668,12 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||||||
;
|
;
|
||||||
|
|
||||||
$this->assertNull($user);
|
$this->assertNull($user);
|
||||||
|
|
||||||
|
$entries = $client->getContainer()
|
||||||
|
->get('doctrine.orm.entity_manager')
|
||||||
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
|
->findByUser($this->getLoggedInUserId());
|
||||||
|
|
||||||
|
$this->assertEmpty($entries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user