Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

SymfonyMailerContext #112

Open
wants to merge 13 commits into
base: refactoring/new-extension
Choose a base branch
from

Conversation

umpirsky
Copy link
Contributor

  • @then no email should have been sent
  • @then email with subject :subject should not be sent
  • @then email should not be sent to :recipient
  • @then email with subject :subject should not be sent to :recipient
  • @then the following emails should not be sent:
  • @then :count emails should have been sent
  • @then email with subject :subject should have been sent
  • @then email should have been sent to :recipient
  • @then email with subject :subject should have been sent to :recipient
  • @then the following emails should have been sent:

@umpirsky
Copy link
Contributor Author

@PedroTroller I would like to add context class and write scenarios. But I am afraid I will need almost full symfony app, with container, kernel and everything. What do you think?

@PedroTroller
Copy link
Member

I think we need somthink like the fixture APP into KnpRevealsBundle : https://github.com/KnpLabs/KnpRevealBundle/tree/master/features/fixtures
By the way, I need it too to test the entity part.


protected function getCollector()
{
return $this->get('swiftmailer')->getCollector('swiftmailer');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in fact you can't get a service with() get method. This method allow you to call others helpers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aitboudad
Copy link
Contributor

👍

@aitboudad
Copy link
Contributor

What's about when sending an email and then immediately redirecting to another page ?? Using MinkRedirectContext is an alternative but I guess you have another better solution :)

@umpirsky
Copy link
Contributor Author

@aitboudad Yes. I also submitted some improvements in Behat/CommonContexts#54 but they never merge.

@umpirsky umpirsky force-pushed the feature/symfony-mailer-context branch from 14f8c77 to b27924c Compare November 8, 2014 13:17
@umpirsky umpirsky force-pushed the feature/symfony-mailer-context branch from 25f4313 to b28a1c3 Compare December 19, 2014 09:42
@umpirsky umpirsky changed the title [WIP] SymfonyMailerContext SymfonyMailerContext Dec 19, 2014
@umpirsky
Copy link
Contributor Author

@PedroTroller Feedback is appreciated.

@akovalyov
Copy link
Contributor

@umpirsky could you add a little bit of docs? Then we can merge it - personally I like it.

@umpirsky
Copy link
Contributor Author

@akovalyov I was waiting for some @PedroTroller feedback.

@akovalyov
Copy link
Contributor

@PedroTroller could you give any feedback on this cool work? :)

@cursedcoder
Copy link
Contributor

+1

Scenario: No emails sent
When I go to the noEmails page
Then no email should have been sent
And 0 emails should have been sent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 email

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's 0 emails. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursedcoder I think your link is about saying "zeros" or "zeroes" and not how to accord the noun after zero. But maybe I'm missing something.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, @umpirsky seems right on this one ;) http://english.stackexchange.com/a/13075

@Einenlum
Copy link

Is this still up to date?

Copy link
Contributor

@Nek- Nek- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR could have significant improvements. It forces to enable the profiler to collect in test environment, what could seriously impact test suite performance. Maybe we could provide a configurable implementation where the user could configure its own email provider (I think the user may prefer check headers or spool ?).

Otherwise, I think this project really needs more functional tests. Those of Behat are a great source of inspiration to write them.

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done with the micro kernel :) .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants