]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/ApiBundle/Controller/SearchRestControllerTest.php
Factorize sendResponse between Api controllers
[github/wallabag/wallabag.git] / tests / Wallabag / ApiBundle / Controller / SearchRestControllerTest.php
index 5900ae53bf87716cd6a84e85507ebc96eb9d9935..fd5246393b31536d8a516fa7e0610c36d3c93d99 100644 (file)
@@ -3,10 +3,6 @@
 namespace Tests\Wallabag\ApiBundle\Controller;
 
 use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
-use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\CoreBundle\Entity\Tag;
-use Wallabag\CoreBundle\Helper\ContentProxy;
-use Wallabag\UserBundle\Entity\User;
 
 class SearchRestControllerTest extends WallabagApiTestCase
 {
@@ -15,14 +11,14 @@ class SearchRestControllerTest extends WallabagApiTestCase
         $this->client->request('GET', '/api/search', [
             'page' => 1,
             'perPage' => 2,
-            'term' => 'entry' // 6 results
+            'term' => 'entry', // 6 results
         ]);
 
         $this->assertSame(200, $this->client->getResponse()->getStatusCode());
 
         $content = json_decode($this->client->getResponse()->getContent(), true);
 
-        $this->assertGreaterThanOrEqual(1, count($content));
+        $this->assertGreaterThanOrEqual(1, \count($content));
         $this->assertArrayHasKey('items', $content['_embedded']);
         $this->assertGreaterThanOrEqual(0, $content['total']);
         $this->assertSame(1, $content['page']);
@@ -45,14 +41,14 @@ class SearchRestControllerTest extends WallabagApiTestCase
     public function testGetSearchWithNoLimit()
     {
         $this->client->request('GET', '/api/search', [
-            'term' => 'entry'
+            'term' => 'entry',
         ]);
 
         $this->assertSame(200, $this->client->getResponse()->getStatusCode());
 
         $content = json_decode($this->client->getResponse()->getContent(), true);
 
-        $this->assertGreaterThanOrEqual(1, count($content));
+        $this->assertGreaterThanOrEqual(1, \count($content));
         $this->assertArrayHasKey('items', $content['_embedded']);
         $this->assertGreaterThanOrEqual(0, $content['total']);
         $this->assertSame(1, $content['page']);