]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php
Enable PHPStan
[github/wallabag/wallabag.git] / tests / Wallabag / UserBundle / Mailer / CountableMemorySpool.php
diff --git a/tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php b/tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php
new file mode 100644 (file)
index 0000000..53f240a
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace Tests\Wallabag\UserBundle\Mailer;
+
+/**
+ * @see https://www.pmg.com/blog/integration-testing-swift-mailer/
+ */
+final class CountableMemorySpool extends \Swift_MemorySpool implements \Countable
+{
+    public function count()
+    {
+        return \count($this->messages);
+    }
+
+    public function getMessages()
+    {
+        return $this->messages;
+    }
+}