From 9cf4096d456b0d5f406c7625321b422c1cc241f6 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 15 Mar 2021 14:18:37 +0100 Subject: [PATCH 1/2] Added "See also" I shortened the example, cause `$emails[0]->getTo()[0];` looks strange ;-) Instead, I added the "See also"-links which (I think) are a good idea in general since the page gets longer and longer, so it's harder to get an overview what functions do exist at all... The `@var` annotation syntax is taken from https://phpstan.org/writing-php-code/phpdoc-types#general-arrays - I'm not 100% sure if this is the right way. The closing `*/` in my new `@var` line might break the page rendering completely ;-) (same as in https://github.com/Codeception/module-symfony/pull/119) - is there a way to escape this? --- src/Codeception/Module/Symfony/MailerAssertionsTrait.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php index d51769e2..35bfb7cd 100644 --- a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php @@ -39,6 +39,7 @@ public function seeEmailIsSent(int $expectedCount = 1): void /** * Returns the last sent email. + * See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails) * * ```php * $emails */ * $emails = $I->grabSentEmails(); - * $address = $emails[0]->getTo()[0]; - * $I->assertSame('john_doe@user.com', $address->getAddress()); * ``` * * @return \Symfony\Component\Mime\Email[] @@ -90,4 +91,4 @@ protected function getMessageMailerEvents(): MessageEvents $this->fail("Emails can't be tested without Symfony Mailer service."); } -} \ No newline at end of file +} From ba4fd6ddd9da5c91e2f4c7ed23b0948acb3f6c1c Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 15 Mar 2021 17:08:08 +0100 Subject: [PATCH 2/2] Update MailerAssertionsTrait.php --- src/Codeception/Module/Symfony/MailerAssertionsTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php index 35bfb7cd..5c41c1d9 100644 --- a/src/Codeception/Module/Symfony/MailerAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/MailerAssertionsTrait.php @@ -66,7 +66,7 @@ public function grabLastSentEmail(): ?Email * * ```php * $emails */ + * /** @var array $emails {@*} * $emails = $I->grabSentEmails(); * ``` *