Merge pull request #2359 from wallabag/user-config

Create config even if user is disabled
This commit is contained in:
Nicolas Lœuillet 2016-10-04 13:35:13 +02:00 committed by GitHub
commit f2ab290f0f
3 changed files with 0 additions and 44 deletions

View file

@ -41,31 +41,11 @@ env:
matrix:
fast_finish: true
include:
# driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
- php: hhvm-3.12
sudo: required
dist: trusty
group: edge
env: DB=mysql
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
services:
- mysql
- php: hhvm-3.12
sudo: required
dist: trusty
group: edge
env: DB=sqlite
- php: 7.0
env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite
- php: 7.0
env: DB=sqlite ASSETS=build
allow_failures:
- php: hhvm-3.12
- php: 7.1
- php: nightly

View file

@ -45,10 +45,6 @@ class CreateConfigListener implements EventSubscriberInterface
public function createConfig(UserEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)
{
if (!$event->getUser()->isEnabled()) {
return;
}
$config = new Config($event->getUser());
$config->setTheme($this->theme);
$config->setItemsPerPage($this->itemsOnPage);

View file

@ -41,26 +41,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();