From 1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 17 Jan 2019 14:28:05 +0100 Subject: Enable PHPStan - Fix error for level 0 & 1 (level 7 has 699 errors...) - Add `updated_at` to site_credential (so the `timestamps()` method applies correctly) --- .../Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php | 16 ---------------- .../UserBundle/Mailer/CountableMemorySpool.php | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 tests/Wallabag/UserBundle/Mailer/CountableMemorySpool.php (limited to 'tests/Wallabag/UserBundle/Mailer') diff --git a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php index aa176068..e34e13a8 100644 --- a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php +++ b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php @@ -6,22 +6,6 @@ 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 TestCase { protected $mailer; 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 @@ +messages); + } + + public function getMessages() + { + return $this->messages; + } +} -- cgit v1.2.3 From a6b242a1fd6f8900d80354361449f1bf62506ef9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Dec 2018 12:43:05 +0100 Subject: Enable OTP 2FA - Update SchebTwoFactorBundle to version 3 - Enable Google 2fa on the bundle - Disallow ability to use both email and google as 2fa - Update Ocramius Proxy Manager to handle typed function & attributes (from PHP 7) - use `$this->addFlash` shortcut instead of `$this->get('session')->getFlashBag()->add` - update admin to be able to create/reset the 2fa --- tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/Wallabag/UserBundle/Mailer') diff --git a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php index e34e13a8..1713c10c 100644 --- a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php +++ b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php @@ -33,7 +33,7 @@ TWIG; public function testSendEmail() { $user = new User(); - $user->setTwoFactorAuthentication(true); + $user->setEmailTwoFactor(true); $user->setEmailAuthCode(666666); $user->setEmail('test@wallabag.io'); $user->setName('Bob'); -- cgit v1.2.3 From a2f4efe6d2a90d8a2b84a275f48a07dc8aa0a84f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 21 Jun 2019 12:46:53 +0200 Subject: Use Twig 2.0 `mnapoli/piwik-twig-extension` locked Twig to the 1.10 version. The new version is compatible with Twig 2.0 --- tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/Wallabag/UserBundle/Mailer') diff --git a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php index 1713c10c..4f93a92c 100644 --- a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php +++ b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php @@ -3,6 +3,8 @@ namespace Tests\Wallabag\UserBundle\Mailer; use PHPUnit\Framework\TestCase; +use Twig\Environment; +use Twig\Loader\ArrayLoader; use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Mailer\AuthCodeMailer; @@ -27,7 +29,7 @@ class AuthCodeMailerTest extends TestCase {% block body_text %}text body {{ support_url }}{% endblock %} TWIG; - $this->twig = new \Twig_Environment(new \Twig_Loader_Array(['WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate])); + $this->twig = new Environment(new ArrayLoader(['WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate])); } public function testSendEmail() -- cgit v1.2.3