Skip to content

Commit 9cf4096

Browse files
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 Codeception#119) - is there a way to escape this?
1 parent 42dda3c commit 9cf4096

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Codeception/Module/Symfony/MailerAssertionsTrait.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function seeEmailIsSent(int $expectedCount = 1): void
3939

4040
/**
4141
* Returns the last sent email.
42+
* See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails)
4243
*
4344
* ```php
4445
* <?php
@@ -61,12 +62,12 @@ public function grabLastSentEmail(): ?Email
6162

6263
/**
6364
* Returns an array of all sent emails.
65+
* See also: [grabLastSentEmail()](https://codeception.com/docs/modules/Symfony#grabLastSentEmail).
6466
*
6567
* ```php
6668
* <?php
69+
* /** @var array<int, \Symfony\Component\Mime\Email> $emails */
6770
* $emails = $I->grabSentEmails();
68-
* $address = $emails[0]->getTo()[0];
69-
* $I->assertSame('john_doe@user.com', $address->getAddress());
7071
* ```
7172
*
7273
* @return \Symfony\Component\Mime\Email[]
@@ -90,4 +91,4 @@ protected function getMessageMailerEvents(): MessageEvents
9091

9192
$this->fail("Emails can't be tested without Symfony Mailer service.");
9293
}
93-
}
94+
}

0 commit comments

Comments
 (0)