aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-25 15:54:20 +0200
committerGitHub <noreply@github.com>2017-05-25 15:54:20 +0200
commit3e395a6bc63cba16b0772a382f6cbac0ce4ab906 (patch)
tree220eaf3400aeeea821b7e150855a1d44f1b5bfe9 /tests/api/controllers
parentb2e2aa42e288e0becaa95bf9cc3be679743fc98e (diff)
parent7d86f40bdb2135655b5b4fe8cbcc1ac102114f86 (diff)
downloadShaarli-3e395a6bc63cba16b0772a382f6cbac0ce4ab906.tar.gz
Shaarli-3e395a6bc63cba16b0772a382f6cbac0ce4ab906.tar.zst
Shaarli-3e395a6bc63cba16b0772a382f6cbac0ce4ab906.zip
Merge pull request #841 from ArthurHoaro/feature/search-no-tag
Empty tag search will look for not tagged links
Diffstat (limited to 'tests/api/controllers')
-rw-r--r--tests/api/controllers/GetLinksTest.php4
-rw-r--r--tests/api/controllers/InfoTest.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/api/controllers/GetLinksTest.php b/tests/api/controllers/GetLinksTest.php
index 84ae7f7a..4cb70224 100644
--- a/tests/api/controllers/GetLinksTest.php
+++ b/tests/api/controllers/GetLinksTest.php
@@ -95,7 +95,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
95 $this->assertEquals($this->refDB->countLinks(), count($data)); 95 $this->assertEquals($this->refDB->countLinks(), count($data));
96 96
97 // Check order 97 // Check order
98 $order = [41, 8, 6, 7, 0, 1, 4, 42]; 98 $order = [41, 8, 6, 7, 0, 1, 9, 4, 42];
99 $cpt = 0; 99 $cpt = 0;
100 foreach ($data as $link) { 100 foreach ($data as $link) {
101 $this->assertEquals(self::NB_FIELDS_LINK, count($link)); 101 $this->assertEquals(self::NB_FIELDS_LINK, count($link));
@@ -164,7 +164,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase
164 $data = json_decode((string) $response->getBody(), true); 164 $data = json_decode((string) $response->getBody(), true);
165 $this->assertEquals($this->refDB->countLinks(), count($data)); 165 $this->assertEquals($this->refDB->countLinks(), count($data));
166 // Check order 166 // Check order
167 $order = [41, 8, 6, 7, 0, 1, 4, 42]; 167 $order = [41, 8, 6, 7, 0, 1, 9, 4, 42];
168 $cpt = 0; 168 $cpt = 0;
169 foreach ($data as $link) { 169 foreach ($data as $link) {
170 $this->assertEquals(self::NB_FIELDS_LINK, count($link)); 170 $this->assertEquals(self::NB_FIELDS_LINK, count($link));
diff --git a/tests/api/controllers/InfoTest.php b/tests/api/controllers/InfoTest.php
index e85eb281..f7e63bfa 100644
--- a/tests/api/controllers/InfoTest.php
+++ b/tests/api/controllers/InfoTest.php
@@ -81,7 +81,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase
81 $this->assertEquals(200, $response->getStatusCode()); 81 $this->assertEquals(200, $response->getStatusCode());
82 $data = json_decode((string) $response->getBody(), true); 82 $data = json_decode((string) $response->getBody(), true);
83 83
84 $this->assertEquals(8, $data['global_counter']); 84 $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, $data['global_counter']);
85 $this->assertEquals(2, $data['private_counter']); 85 $this->assertEquals(2, $data['private_counter']);
86 $this->assertEquals('Shaarli', $data['settings']['title']); 86 $this->assertEquals('Shaarli', $data['settings']['title']);
87 $this->assertEquals('?', $data['settings']['header_link']); 87 $this->assertEquals('?', $data['settings']['header_link']);
@@ -104,7 +104,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase
104 $this->assertEquals(200, $response->getStatusCode()); 104 $this->assertEquals(200, $response->getStatusCode());
105 $data = json_decode((string) $response->getBody(), true); 105 $data = json_decode((string) $response->getBody(), true);
106 106
107 $this->assertEquals(8, $data['global_counter']); 107 $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, $data['global_counter']);
108 $this->assertEquals(2, $data['private_counter']); 108 $this->assertEquals(2, $data['private_counter']);
109 $this->assertEquals($title, $data['settings']['title']); 109 $this->assertEquals($title, $data['settings']['title']);
110 $this->assertEquals($headerLink, $data['settings']['header_link']); 110 $this->assertEquals($headerLink, $data['settings']['header_link']);