phpunit - LogicException: Missing default data in Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector -


Receive this exception in Symfony 2.5.5 with Swiftmailer 5.3.0. I am actually following following the following error call MessageDataCollector # getMessages () :

  // An email is sent, this $ - Sending; - assertEquals (1, $ mailCollector -> getMessageCount ()); $ CollectedMessages = $ mailCollector-> incoming message (); $ Message = $ aggregated message [0];   

The claim of message counting has also failed with the value of zero.

As far as I can tell the collector, no one has been able to collect any realities in action. Any ideas?

I had to face the same problem once I applied. I could see the result of mail sent in the web profiler when running the development version, but data could not be found in the test environment.

After applying Chris Speak, I noticed that Swiftmailer.mailer.default.plugin.messagelogger service was not registered with the container during testing, so the MessageDataCollector class < / Strong> did not have the archive () method to log the data to send mail. This is why it was not possible to obtain information from the swiftmailer collector.

The solution is to either not override the initializeContainer () method in AppKernel.php or to override it, but it To make sure that the Messagogger service is available to send mail cases.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -