X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2FWallabag%2FUserBundle%2FEventListener%2FCreateConfigListenerTest.php;h=d976c4ac6b0a2d974b9b496261bd84760deedbe2;hb=92a66835624acf6fd14f5adc5f8aab399658592e;hp=01796dedd4b7d95ce682b6616c3f336ec69b94e7;hpb=24becc9717423748e6ef06c6cf1c499435af66b9;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php index 01796ded..d976c4ac 100644 --- a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php +++ b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php @@ -4,14 +4,17 @@ 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 Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; 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; @@ -21,6 +24,7 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { + $session = new Session(new MockArraySessionStorage()); $this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager') ->disableOriginalConstructor() ->getMock(); @@ -33,7 +37,8 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase 'fr', 1, 1, - 1 + 1, + $session ); $this->dispatcher = new EventDispatcher(); @@ -57,13 +62,13 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase $config = new Config($user); $config->setTheme('baggy'); $config->setItemsPerPage(20); - $config->setRssLimit(50); + $config->setFeedLimit(50); $config->setLanguage('fr'); $config->setReadingSpeed(1); $this->em->expects($this->once()) ->method('persist') - ->will($this->returnValue($config)); + ->willReturn($config); $this->em->expects($this->once()) ->method('flush');