X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FUserBundle%2FMailer%2FAuthCodeMailerTest.php;h=e34e13a8a29cf2a7bab12a7a163f57ea226114c8;hb=1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f;hp=21412da6e544d07d02f3b31d7f892207ff166049;hpb=3be554c78f1d68c3969a85d163d9bb081ba525d0;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php index 21412da6..e34e13a8 100644 --- a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php +++ b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php @@ -2,26 +2,11 @@ namespace Tests\Wallabag\UserBundle\Mailer; +use PHPUnit\Framework\TestCase; use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Mailer\AuthCodeMailer; -/** - * @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; - } -} - -class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase +class AuthCodeMailerTest extends TestCase { protected $mailer; protected $spool; @@ -68,8 +53,8 @@ TWIG; $msg = $this->spool->getMessages()[0]; $this->assertArrayHasKey('test@wallabag.io', $msg->getTo()); - $this->assertEquals(['nobody@test.io' => 'wallabag test'], $msg->getFrom()); - $this->assertEquals('subject', $msg->getSubject()); + $this->assertSame(['nobody@test.io' => 'wallabag test'], $msg->getFrom()); + $this->assertSame('subject', $msg->getSubject()); $this->assertContains('text body http://0.0.0.0/support', $msg->toString()); $this->assertContains('html body 666666', $msg->toString()); }