forked from KnpLabs/KnpUserBundle
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3082 from stof/deprecate_swiftmailer
Deprecate the TwigSwiftMailer implementation
- Loading branch information
Showing
6 changed files
with
44 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
|
||
/** | ||
* @author Christophe Coevoet <[email protected]> | ||
* | ||
* @deprecated | ||
*/ | ||
class TwigSwiftMailer implements MailerInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,14 +100,14 @@ public function testDisableRegistration() | |
$loader->load([$config], $this->configuration); | ||
$this->assertNotHasDefinition('fos_user.registration.form.factory'); | ||
|
||
$mailer = $this->configuration->getDefinition('fos_user.mailer.twig_swift'); | ||
$mailer = $this->configuration->getDefinition('fos_user.mailer.twig_symfony'); | ||
$parameters = $this->configuration->getParameterBag()->resolveValue( | ||
$mailer->getArgument(3) | ||
); | ||
$this->assertSame( | ||
[ | ||
'confirmation' => ['[email protected]' => 'Acme Ltd'], | ||
'resetting' => ['[email protected]' => 'Acme Corp'], | ||
'confirmation' => ['address' => '[email protected]', 'sender_name' => 'Acme Ltd'], | ||
'resetting' => ['address' => '[email protected]', 'sender_name' => 'Acme Corp'], | ||
], | ||
$parameters['from_email'] | ||
); | ||
|
@@ -122,14 +122,14 @@ public function testDisableResetting() | |
$loader->load([$config], $this->configuration); | ||
$this->assertNotHasDefinition('fos_user.resetting.form.factory'); | ||
|
||
$mailer = $this->configuration->getDefinition('fos_user.mailer.twig_swift'); | ||
$mailer = $this->configuration->getDefinition('fos_user.mailer.twig_symfony'); | ||
$parameters = $this->configuration->getParameterBag()->resolveValue( | ||
$mailer->getArgument(3) | ||
); | ||
$this->assertSame( | ||
[ | ||
'confirmation' => ['[email protected]' => 'Acme Corp'], | ||
'resetting' => ['[email protected]' => 'Acme Ltd'], | ||
'confirmation' => ['address' => '[email protected]', 'sender_name' => 'Acme Corp'], | ||
'resetting' => ['address' => '[email protected]', 'sender_name' => 'Acme Ltd'], | ||
], | ||
$parameters['from_email'] | ||
); | ||
|
@@ -166,8 +166,8 @@ public function testEmailsDisabledFeature($testConfig, $registration, $resetting | |
$config = array_merge($config, $testConfig); | ||
$loader->load([$config], $this->configuration); | ||
|
||
$this->assertParameter($registration, 'fos_user.registration.confirmation.from_email'); | ||
$this->assertParameter($resetting, 'fos_user.resetting.email.from_email'); | ||
$this->assertParameter($registration, 'fos_user.registration.confirmation.from_address'); | ||
$this->assertParameter($resetting, 'fos_user.resetting.email.from_address'); | ||
} | ||
|
||
public function providerEmailsDisabledFeature() | ||
|
@@ -190,13 +190,13 @@ public function providerEmailsDisabledFeature() | |
], | ||
]; | ||
|
||
$default = ['[email protected]' => 'Acme Corp']; | ||
$overriden = ['[email protected]' => 'Acme Ltd']; | ||
$default = ['address' => '[email protected]', 'sender_name' => 'Acme Corp']; | ||
$overriden = ['address' => '[email protected]', 'sender_name' => 'Acme Ltd']; | ||
|
||
return [ | ||
[$configBothFeaturesDisabled, ['[email protected]' => 'Acme Ltd'], ['[email protected]' => 'Acme Ltd']], | ||
[$configResettingDisabled, $default, ['[email protected]' => 'Acme Ltd']], | ||
[$configRegistrationDisabled, ['[email protected]' => 'Acme Ltd'], $default], | ||
[$configBothFeaturesDisabled, ['address' => '[email protected]', 'sender_name' => 'Acme Ltd'], ['address' => '[email protected]', 'sender_name' => 'Acme Ltd']], | ||
[$configResettingDisabled, $default, ['address' => '[email protected]', 'sender_name' => 'Acme Ltd']], | ||
[$configRegistrationDisabled, ['address' => '[email protected]', 'sender_name' => 'Acme Ltd'], $default], | ||
[$configOverridenRegistrationEmail, $overriden, $default], | ||
[$configOverridenResettingEmail, $default, $overriden], | ||
]; | ||
|
@@ -289,10 +289,10 @@ public function testUserLoadConfirmationEmailWithDefaults() | |
$this->createEmptyConfiguration(); | ||
|
||
$this->assertParameter(false, 'fos_user.registration.confirmation.enabled'); | ||
$this->assertParameter(['[email protected]' => 'Acme Corp'], 'fos_user.registration.confirmation.from_email'); | ||
$this->assertParameter(['address' => '[email protected]', 'sender_name' => 'Acme Corp'], 'fos_user.registration.confirmation.from_address'); | ||
$this->assertParameter('@FOSUser/Registration/email.txt.twig', 'fos_user.registration.confirmation.template'); | ||
$this->assertParameter('@FOSUser/Resetting/email.txt.twig', 'fos_user.resetting.email.template'); | ||
$this->assertParameter(['[email protected]' => 'Acme Corp'], 'fos_user.resetting.email.from_email'); | ||
$this->assertParameter(['address' => '[email protected]', 'sender_name' => 'Acme Corp'], 'fos_user.resetting.email.from_address'); | ||
$this->assertParameter(86400, 'fos_user.resetting.token_ttl'); | ||
} | ||
|
||
|
@@ -301,10 +301,10 @@ public function testUserLoadConfirmationEmail() | |
$this->createFullConfiguration(); | ||
|
||
$this->assertParameter(true, 'fos_user.registration.confirmation.enabled'); | ||
$this->assertParameter(['[email protected]' => 'Acme Corp'], 'fos_user.registration.confirmation.from_email'); | ||
$this->assertParameter(['address' => '[email protected]', 'sender_name' => 'Acme Corp'], 'fos_user.registration.confirmation.from_address'); | ||
$this->assertParameter('AcmeMyBundle:Registration:mail.txt.twig', 'fos_user.registration.confirmation.template'); | ||
$this->assertParameter('AcmeMyBundle:Resetting:mail.txt.twig', 'fos_user.resetting.email.template'); | ||
$this->assertParameter(['[email protected]' => 'Acme Corp'], 'fos_user.resetting.email.from_email'); | ||
$this->assertParameter(['address' => '[email protected]', 'sender_name' => 'Acme Corp'], 'fos_user.resetting.email.from_address'); | ||
$this->assertParameter(7200, 'fos_user.resetting.retry_ttl'); | ||
} | ||
|
||
|