mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-1972: Account Page, Allow a Phraseanet User to delete his account and associated datas (#2918)
* allow user to delete account * generate translation and add checkbox in the windows confirmation * change text an configuration key * update delete account fonctionality * rename variable * write in explicite condition * merge yarn.lock * regenerate translation
This commit is contained in:
@@ -19,6 +19,7 @@ class RepositoriesServiceProviderTest extends ServiceProviderTestCase
|
||||
['Alchemy\Phrasea\Core\Provider\RepositoriesServiceProvider', 'repo.baskets', 'Alchemy\Phrasea\Model\Repositories\BasketRepository'],
|
||||
['Alchemy\Phrasea\Core\Provider\RepositoriesServiceProvider', 'repo.basket-elements', 'Alchemy\Phrasea\Model\Repositories\BasketElementRepository'],
|
||||
['Alchemy\Phrasea\Core\Provider\RepositoriesServiceProvider', 'repo.validation-participants', 'Alchemy\Phrasea\Model\Repositories\ValidationParticipantRepository'],
|
||||
['Alchemy\Phrasea\Core\Provider\RepositoriesServiceProvider', 'repo.validation-session', 'Alchemy\Phrasea\Model\Repositories\ValidationSessionRepository'],
|
||||
['Alchemy\Phrasea\Core\Provider\RepositoriesServiceProvider', 'repo.story-wz', 'Alchemy\Phrasea\Model\Repositories\StoryWZRepository'],
|
||||
['Alchemy\Phrasea\Core\Provider\RepositoriesServiceProvider', 'repo.orders', 'Alchemy\Phrasea\Model\Repositories\OrderRepository'],
|
||||
['Alchemy\Phrasea\Core\Provider\RepositoriesServiceProvider', 'repo.order-elements', 'Alchemy\Phrasea\Model\Repositories\OrderElementRepository'],
|
||||
|
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Notification\Mail;
|
||||
|
||||
use Alchemy\Phrasea\Exception\LogicException;
|
||||
use Alchemy\Phrasea\Notification\Mail\MailRequestAccountDelete;
|
||||
|
||||
/**
|
||||
* @group functional
|
||||
* @group legacy
|
||||
* @covers Alchemy\Phrasea\Notification\Mail\MailRequestAccountDelete
|
||||
*/
|
||||
class MailRequestAccountDeleteTest extends MailWithLinkTestCase
|
||||
{
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Notification\Mail\MailRequestAccountDelete::setUserOwner
|
||||
*/
|
||||
public function testSetUserOwner()
|
||||
{
|
||||
$this->assertEquals('Email:deletion:request:message Hello %civility% %firstName% %lastName%.
|
||||
We have received an account deletion request for your account on %urlInstance%, please confirm this deletion by clicking on the link below.
|
||||
If you are not at the origin of this request, please change your password as soon as possible %resetPassword%
|
||||
Link is valid for one hour.', $this->getMail()->getMessage());
|
||||
}
|
||||
|
||||
public function testShouldThrowALogicExceptionIfNoUserProvided()
|
||||
{
|
||||
$mail = MailRequestAccountDelete::create(
|
||||
$this->getApplication(),
|
||||
$this->getReceiverMock(),
|
||||
$this->getEmitterMock(),
|
||||
$this->getMessage(),
|
||||
$this->getUrl(),
|
||||
$this->getExpiration()
|
||||
);
|
||||
|
||||
try {
|
||||
$mail->getMessage();
|
||||
$this->fail('Should have raised an exception');
|
||||
} catch (LogicException $e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getMail()
|
||||
{
|
||||
$mail = MailRequestAccountDelete::create(
|
||||
$this->getApplication(),
|
||||
$this->getReceiverMock(),
|
||||
$this->getEmitterMock(),
|
||||
$this->getMessage(),
|
||||
$this->getUrl(),
|
||||
$this->getExpiration()
|
||||
);
|
||||
|
||||
$user = $this->createUserMock();
|
||||
|
||||
$user->expects($this->any())
|
||||
->method('getDisplayName')
|
||||
->will($this->returnValue('JeanPhil'));
|
||||
|
||||
$mail->setUserOwner($user);
|
||||
|
||||
return $mail;
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Notification\Mail;
|
||||
|
||||
use Alchemy\Phrasea\Notification\Mail\MailSuccessAccountDelete;
|
||||
|
||||
/**
|
||||
* @group functional
|
||||
* @group legacy
|
||||
* @covers Alchemy\Phrasea\Notification\Mail\MailSuccessAccountDelete
|
||||
*/
|
||||
class MailSuccessAccountDeleteTest extends MailTestCase
|
||||
{
|
||||
public function getMail()
|
||||
{
|
||||
return MailSuccessAccountDelete::create(
|
||||
$this->getApplication(),
|
||||
$this->getReceiverMock(),
|
||||
$this->getEmitterMock(),
|
||||
$this->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user