GithubHelp home page GithubHelp logo

mailcatcher's People

Contributors

akovalyov avatar alexandresalome avatar alexislefebvre avatar blazarecki avatar captbaritone avatar chtipepere avatar damour avatar diegohq avatar gmorel avatar lyrixx avatar mattparker avatar nucleartux avatar owlycode avatar pfz avatar pix-art avatar sgomez avatar syl20b avatar troytft avatar vincentmoulene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mailcatcher's Issues

MIME messages may have content before the boundary

I think this:

Content-Type: multipart/mixed;
 boundary=frontier
MIME-Version: 1.0

This is a message in Mime Format.  If you see this, your mail reader does not support this format.

--frontier
Here is the real content

is legit (http://en.wikipedia.org/wiki/MIME#Multipart_messages) but throws an Exception if that's what the message looks like

1) Alex\MailCatcher\Tests\MessagePartTest::testMultiPartWithAMimeFormatWarningMessage
InvalidArgumentException: Error while parsing "Expected "--=_dba29f3ae3414895d994f90b8b013498", but got "This is a message in Mime Format.  I" (This is a )" (cursor: 0, text: "This is a ").
#0 /home/matt/projects/mailcatcher/Mime/Parser.php(50): Alex\MailCatcher\Mime\Parser->consume('--=_dba29f3ae34...')
#1 /home/matt/projects/mailcatcher/Mime/Parser.php(20): Alex\MailCatcher\Mime\Parser->doParseBoundary('=_dba29f3ae3414...')

[DOCUMENTATION] Apply an update to add MailCatcherContext in behat.yml

Hi, i have just a suggestion to do to update documentation.

It would be easier to add how to add MailCatcherContext to behat.yml in order to be available to use mail test functions in scenario.

Then, in behat.yml you need to add this context in the list:
- Alex\MailCatcher\Behat\MailCatcherContext.

Otherwise, it does not work.

Creation of a trait

It'd be great to have access to a trait I can include in my suites contexts that gives me access to the same functionality rather then loading this as a sub-context.

Criteria always fail

Fist of all, superb solution to a common problem. Nice!

I'm having trouble opening email. The assertion And 1 mail should be sent works fine, but any way to open email fails.

The scenario: And I open mail with subject "Password reset"

Shows: Unable to find a message with criterias "{"subject":"Password reset"}".

But I'm sure the email is sent and the subject is indeed Password reset (I checked it manually in mailcatcher). Any ideas? I'm running mailcatcher 0.5.12

Can't seem to change the url for the client

I have the following behat.yml file:

default:
    suites:
        default:
            paths: [%paths.base%/features/]
            contexts:
                - FeatureContext
                - Behat\MinkExtension\Context\MinkContext
                - Alex\MailCatcher\Behat\MailCatcherContext

    extensions:
        Behat\MinkExtension:
            base_url: "http://login.dev"
            sessions:
                default:
                    goutte: ~

                javascript:
                    selenium2: ~

        Alex\MailCatcher\Behat\MailCatcherExtension\Extension:
            url: http://login.dev:1080
            purge_before_scenario: true

I'm requiring behat 3 and your extension:

    "require-dev": {
        "behat/behat": "3.0.*",
        "behat/mink-extension": "2.0.*",
        "behat/mink-goutte-driver": "1.1.*",
        "behat/mink-selenium2-driver": "1.2.*",
        "alexandresalome/mailcatcher": "1.0.*"
    }

Debugging the mailcatcher context in my own featurecontext file results in a Client with "http://localhost:1080" as url, which is the default value.

Changing "self::MAILCATCHER_ID" to "behat.mailcatcher.client" on line 54 in Extension.php resolved the issue for me, but I have not enough knowledge about your package for me to feel confident about creating a PR.

What is going wrong in my setup? Is my hardcoded fix actually desired?

v0.3.0

Hi,

Is it possible to get stable v0.3.0 in the near future?

Best regards,
Michal

Access to the private properties?

In the Behat context of one project, we extend the MailCacherContext with the following line:

$this->mailCatcherContext = $environment->getContext('Alex\MailCatcher\Behat\MailCatcherContext');

We can't access to the current message because of the function declaration:

 private function getCurrentMessage()

We can't change the visibility of this function since it may break classes that inherit from this class.

Can we add a public method in MailCatcherContext to allow accessing to the current message?

I can submit a PR if you agree with this suggestion.

Laravel 5: BindingResolutionException (ExceptionHandler) when using MailCatcherContext

I'm creating Behat tests for a Laravel 5.2 project using Behat 3+, Laravel-Behat-Extension and this package.

My behat.yml is as such:

default:
    autoload:
        - %paths.base%/tests/Behat/Features/Bootstrap/
    suites:
        default:
            paths: [ %paths.base%/tests/Behat/Features ]
            contexts:
                - App\Tests\Behat\Features\Bootstrap\FeatureContext
                - Behat\MinkExtension\Context\MinkContext
                - Alex\MailCatcher\Behat\MailCatcherContext
    extensions:
        Laracasts\Behat: ~
        Behat\MinkExtension:
            default_session: laravel
            laravel: ~
        Alex\MailCatcher\Behat\MailCatcherExtension\Extension:
            url: http://127.0.0.1:1080
            purge_before_scenario: true

When I run

$ vendor/bin/behat

The feature tests "run", but at the end of a scenario I get this:

PHP Fatal Error: Uncaught Illuminate\Contracts\Container\BindingResolutionException:
  Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable.
    in /var/www/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:748
  Stack trace:
    ...

When I comment out the MailCatcherContext in behat.yml my suite works normally:

...
    contexts:
        - App\Tests\Behat\Features\Bootstrap\FeatureContext
        - Behat\MinkExtension\Context\MinkContext
        #- Alex\MailCatcher\Behat\MailCatcherContext
...

The MailCatcherContext is loading OK, as $ vendor/bin/behat -dl displays things like

...
default | When /^I purge mails$/
default | When /^I open mail from "([^"]+)"$/
...

Has this package been tested with Behat 3 and Laravel 5? Any tips on how to debug this and see whether the issue lives inside this package or Laravel?

Mail parser doesn't work with alternative/mixed multipart mail

I had an email (created with SwiftMailer) with only HTML text and a PDF attachment. This library couldn't parse the mail. Then I tried having a text/plain body and an alternative text/html body and finally the PDF attachment.

Both these scenario's didn't work - the problem occurs at line 112 of Part.php.

Do you have an alternative? It seems the mail parser part of this library is just not generic enough to handle all kinds of mail types (including the not particularly exotic type of mail I'm using here). Maybe there is a stand-alone mail parser which could be used as a dependency of this library (I didn't look into this yet, but I will).

Error parsing multipart message with attachment

Hi,

I've forked and created a failing test (https://github.com/mattparker/mailcatcher/blob/master/Tests/MessagePartTest.php) which gives

1) Alex\MailCatcher\Tests\MessagePartTest::testMultiPartWithAttachment
InvalidArgumentException: Unable to parse multipart header: "multipart/mixed; boundary=f46d0447861ff9929f04f143ce67".

I assume that the parser needs to be able to recursively parse the message if there are multiple boundaries? I'll have a go at a fix and see if I can get a pull request together.

The test message was sent to myself from GMail so I think it ought to be parseable.

(And thanks for the lib, btw!)

Matt

Are you abandoning this project?

@alexandresalome this is an awesome tool, but I was just wondering if you were abandoning this project? Reason why I am asking is it would be great to use this with Behat 3. Any chances of this happening?

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.