aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-10-04 13:35:13 +0200
committerGitHub <noreply@github.com>2016-10-04 13:35:13 +0200
commitf2ab290f0fc8a2909bb490e0ed2d91a677a95cc4 (patch)
treede209b59a4b3225b1eb54b7b66c975069cbd1d2d
parentf0b2d57154832fdd6255a1bef0df34a7144806c5 (diff)
parent9a6ac0b47a75f7cc8c8541b3e3fd3f40a3712f4f (diff)
downloadwallabag-f2ab290f0fc8a2909bb490e0ed2d91a677a95cc4.tar.gz
wallabag-f2ab290f0fc8a2909bb490e0ed2d91a677a95cc4.tar.zst
wallabag-f2ab290f0fc8a2909bb490e0ed2d91a677a95cc4.zip
Merge pull request #2359 from wallabag/user-config
Create config even if user is disabled
-rw-r--r--.travis.yml20
-rw-r--r--src/Wallabag/UserBundle/EventListener/CreateConfigListener.php4
-rw-r--r--tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php20
3 files changed, 0 insertions, 44 deletions
diff --git a/.travis.yml b/.travis.yml
index b0b26b56..4170ff04 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -41,31 +41,11 @@ env:
41matrix: 41matrix:
42 fast_finish: true 42 fast_finish: true
43 include: 43 include:
44 # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
45 - php: hhvm-3.12
46 sudo: required
47 dist: trusty
48 group: edge
49 env: DB=mysql
50 addons:
51 apt:
52 packages:
53 - mysql-server-5.6
54 - mysql-client-core-5.6
55 - mysql-client-5.6
56 services:
57 - mysql
58 - php: hhvm-3.12
59 sudo: required
60 dist: trusty
61 group: edge
62 env: DB=sqlite
63 - php: 7.0 44 - php: 7.0
64 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite 45 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite
65 - php: 7.0 46 - php: 7.0
66 env: DB=sqlite ASSETS=build 47 env: DB=sqlite ASSETS=build
67 allow_failures: 48 allow_failures:
68 - php: hhvm-3.12
69 - php: 7.1 49 - php: 7.1
70 - php: nightly 50 - php: nightly
71 51
diff --git a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
index 15f4ac3d..8e2f04e9 100644
--- a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
+++ b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php
@@ -45,10 +45,6 @@ class CreateConfigListener implements EventSubscriberInterface
45 45
46 public function createConfig(UserEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null) 46 public function createConfig(UserEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)
47 { 47 {
48 if (!$event->getUser()->isEnabled()) {
49 return;
50 }
51
52 $config = new Config($event->getUser()); 48 $config = new Config($event->getUser());
53 $config->setTheme($this->theme); 49 $config->setTheme($this->theme);
54 $config->setItemsPerPage($this->itemsOnPage); 50 $config->setItemsPerPage($this->itemsOnPage);
diff --git a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
index 0cebd3e4..a78b77bc 100644
--- a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
+++ b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
@@ -41,26 +41,6 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase
41 $this->response = Response::create(); 41 $this->response = Response::create();
42 } 42 }
43 43
44 public function testWithInvalidUser()
45 {
46 $user = new User();
47 $user->setEnabled(false);
48
49 $event = new FilterUserResponseEvent(
50 $user,
51 $this->request,
52 $this->response
53 );
54
55 $this->em->expects($this->never())->method('persist');
56 $this->em->expects($this->never())->method('flush');
57
58 $this->dispatcher->dispatch(
59 FOSUserEvents::REGISTRATION_COMPLETED,
60 $event
61 );
62 }
63
64 public function testWithValidUser() 44 public function testWithValidUser()
65 { 45 {
66 $user = new User(); 46 $user = new User();