diff options
Diffstat (limited to 'tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php')
-rw-r--r-- | tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php b/tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php new file mode 100644 index 00000000..53f240a1 --- /dev/null +++ b/tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php | |||
@@ -0,0 +1,19 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Tests\Wallabag\UserBundle\Mailer; | ||
4 | |||
5 | /** | ||
6 | * @see https://www.pmg.com/blog/integration-testing-swift-mailer/ | ||
7 | */ | ||
8 | final class CountableMemorySpool extends \Swift_MemorySpool implements \Countable | ||
9 | { | ||
10 | public function count() | ||
11 | { | ||
12 | return \count($this->messages); | ||
13 | } | ||
14 | |||
15 | public function getMessages() | ||
16 | { | ||
17 | return $this->messages; | ||
18 | } | ||
19 | } | ||