mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
UserManipulator should change login on deletion.
PHRAS-812
This commit is contained in:
@@ -104,6 +104,7 @@ class UserManipulator implements ManipulatorInterface
|
|||||||
$old_login = $user->getLogin();
|
$old_login = $user->getLogin();
|
||||||
$old_email = $user->getEmail();
|
$old_email = $user->getEmail();
|
||||||
|
|
||||||
|
$user->setLogin(sprintf('(#deleted_%s_%d)', $old_login, $old_id));
|
||||||
$user->setDeleted(true);
|
$user->setDeleted(true);
|
||||||
$user->setEmail(null);
|
$user->setEmail(null);
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ class UserDeletionTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->apiApplicationManipulator->update($this->apiApplication);
|
$this->apiApplicationManipulator->update($this->apiApplication);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see https://phraseanet.atlassian.net/browse/PHRAS-811
|
||||||
|
*/
|
||||||
public function testRemoveUserWhichLoggedViaOAuthDoesNotThrowException()
|
public function testRemoveUserWhichLoggedViaOAuthDoesNotThrowException()
|
||||||
{
|
{
|
||||||
$app = $this->getApplication();
|
$app = $this->getApplication();
|
||||||
@@ -84,6 +87,16 @@ class UserDeletionTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
$this->apiApplication = null;
|
$this->apiApplication = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see https://phraseanet.atlassian.net/browse/PHRAS-812
|
||||||
|
*/
|
||||||
|
public function testRemoveUserShouldChangeLogin()
|
||||||
|
{
|
||||||
|
$this->userManipulator->delete($this->user);
|
||||||
|
|
||||||
|
$this->assertNotEquals('login', $this->user->getLogin());
|
||||||
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
{
|
{
|
||||||
if ($this->apiApplication) {
|
if ($this->apiApplication) {
|
||||||
|
|||||||
Reference in New Issue
Block a user