symfony-bundle email-bundle
Email bundle for test environment of Symfony2
ton/email-bundle
Email bundle for test environment of Symfony2
- Saturday, September 13, 2014
- by 66ton99
- Repository
- 1 Watchers
- 0 Stars
- 331 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 5 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
EmailBundle
Email bundle for test environment of Symfony2. It allows to store emails as *.eml files and read them after that., (*1)
Setup
config_test.yml, (*2)
swiftmailer:
transport: file
and 'swiftmailer.transport.file' instead of 'file' for SwiftmailerBundle V2.2.?, (*3)
Memory transport
PhpUnitTest.php, (*4)
use Ton\EmailBundle\EventListener\EmailListener;
/**
* @todo check multiple initialization
*/
protected function registerEmailListener()
{
$container = $this->getContainer();
$mailer = $container->get('mailer');
$plugin = new EmailListener();
$mailer->registerPlugin($plugin);
return $plugin;
}
/**
* @test
*/
public function sendEmail()
{
$email = $this->registerEmailListener();
$email->clean();
// Send Email
$this->assertCount(1, $email->getPreSendMessages());
$email->getPreSendMessage(0);
}
dev-master
9999999-dev
Email bundle for test environment of Symfony2
Sources
Download
MIT
The Requires
by
Ton Sharp
test
email
cap
v1.0.0
1.0.0.0
Email bundle for test environment of Symfony2
Sources
Download
MIT
The Requires
by
Ton Sharp
test
email
cap