]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverterTest.php
Enable PHPStan
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / ParamConverter / UsernameRssTokenConverterTest.php
index e29b58b5795c35f3e29d4c56cf854f00f2af541e..800af5c9da835fda31b413be85bf3b0fa301d185 100644 (file)
@@ -1,13 +1,14 @@
 <?php
 
-namespace Tests\Wallabag\CoreBundle\Command;
+namespace Tests\Wallabag\CoreBundle\ParamConverter;
 
+use PHPUnit\Framework\TestCase;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
 use Symfony\Component\HttpFoundation\Request;
 use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter;
 use Wallabag\UserBundle\Entity\User;
 
-class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
+class UsernameRssTokenConverterTest extends TestCase
 {
     public function testSupportsWithNoRegistry()
     {
@@ -125,20 +126,18 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
         $this->assertTrue($converter->supports($params));
     }
 
-    /**
-     * @expectedException InvalidArgumentException
-     * @expectedExceptionMessage Route attribute is missing
-     */
     public function testApplyEmptyRequest()
     {
         $params = new ParamConverter([]);
         $converter = new UsernameRssTokenConverter();
 
-        $converter->apply(new Request(), $params);
+        $res = $converter->apply(new Request(), $params);
+
+        $this->assertFalse($res);
     }
 
     /**
-     * @expectedException Symfony\Component\HttpKernel\Exception\NotFoundHttpException
+     * @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
      * @expectedExceptionMessage User not found
      */
     public function testApplyUserNotFound()
@@ -214,6 +213,6 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
 
         $converter->apply($request, $params);
 
-        $this->assertEquals($user, $request->attributes->get('user'));
+        $this->assertSame($user, $request->attributes->get('user'));
     }
 }