]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
Use namespaced PHPUnit classes
[github/wallabag/wallabag.git] / tests / Wallabag / UserBundle / EventListener / CreateConfigListenerTest.php
index 0cebd3e43731a23dba09040ab0b984a9574e75f1..2b540fdfeb334c20bb64953a340ec1e2c3db6f24 100644 (file)
@@ -4,14 +4,15 @@ namespace Tests\Wallabag\UserBundle\EventListener;
 
 use FOS\UserBundle\Event\FilterUserResponseEvent;
 use FOS\UserBundle\FOSUserEvents;
+use PHPUnit\Framework\TestCase;
 use Symfony\Component\EventDispatcher\EventDispatcher;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 use Wallabag\CoreBundle\Entity\Config;
-use Wallabag\UserBundle\EventListener\CreateConfigListener;
 use Wallabag\UserBundle\Entity\User;
+use Wallabag\UserBundle\EventListener\CreateConfigListener;
 
-class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase
+class CreateConfigListenerTest extends TestCase
 {
     private $em;
     private $listener;
@@ -31,6 +32,8 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase
             20,
             50,
             'fr',
+            1,
+            1,
             1
         );
 
@@ -41,26 +44,6 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase
         $this->response = Response::create();
     }
 
-    public function testWithInvalidUser()
-    {
-        $user = new User();
-        $user->setEnabled(false);
-
-        $event = new FilterUserResponseEvent(
-            $user,
-            $this->request,
-            $this->response
-        );
-
-        $this->em->expects($this->never())->method('persist');
-        $this->em->expects($this->never())->method('flush');
-
-        $this->dispatcher->dispatch(
-            FOSUserEvents::REGISTRATION_COMPLETED,
-            $event
-        );
-    }
-
     public function testWithValidUser()
     {
         $user = new User();