diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-04-01 12:17:37 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-05-25 15:51:12 +0200 |
commit | 7d86f40bdb2135655b5b4fe8cbcc1ac102114f86 (patch) | |
tree | c70ac4ad89a4fc84b8e52114aca7d9755cc92086 /tests/api | |
parent | b64d83cd2b60b6851741787f8ce2ae2c93092841 (diff) | |
download | Shaarli-7d86f40bdb2135655b5b4fe8cbcc1ac102114f86.tar.gz Shaarli-7d86f40bdb2135655b5b4fe8cbcc1ac102114f86.tar.zst Shaarli-7d86f40bdb2135655b5b4fe8cbcc1ac102114f86.zip |
Empty tag search will look for not tagged links
Fixes #784
From now, searching for tags with an empty value will return only not tagged links,
with the search bar showing `x results [not tagged]`.
Note that using the api, the searchtags request parameter must be set to `false` to get the same result.
- [ ] Update API doc
Diffstat (limited to 'tests/api')
-rw-r--r-- | tests/api/controllers/GetLinksTest.php | 4 | ||||
-rw-r--r-- | tests/api/controllers/InfoTest.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/api/controllers/GetLinksTest.php b/tests/api/controllers/GetLinksTest.php index 10330cd9..f1b262bc 100644 --- a/tests/api/controllers/GetLinksTest.php +++ b/tests/api/controllers/GetLinksTest.php | |||
@@ -94,7 +94,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase | |||
94 | $this->assertEquals($this->refDB->countLinks(), count($data)); | 94 | $this->assertEquals($this->refDB->countLinks(), count($data)); |
95 | 95 | ||
96 | // Check order | 96 | // Check order |
97 | $order = [41, 8, 6, 7, 0, 1, 4, 42]; | 97 | $order = [41, 8, 6, 7, 0, 1, 9, 4, 42]; |
98 | $cpt = 0; | 98 | $cpt = 0; |
99 | foreach ($data as $link) { | 99 | foreach ($data as $link) { |
100 | $this->assertEquals(self::NB_FIELDS_LINK, count($link)); | 100 | $this->assertEquals(self::NB_FIELDS_LINK, count($link)); |
@@ -163,7 +163,7 @@ class GetLinksTest extends \PHPUnit_Framework_TestCase | |||
163 | $data = json_decode((string) $response->getBody(), true); | 163 | $data = json_decode((string) $response->getBody(), true); |
164 | $this->assertEquals($this->refDB->countLinks(), count($data)); | 164 | $this->assertEquals($this->refDB->countLinks(), count($data)); |
165 | // Check order | 165 | // Check order |
166 | $order = [41, 8, 6, 7, 0, 1, 4, 42]; | 166 | $order = [41, 8, 6, 7, 0, 1, 9, 4, 42]; |
167 | $cpt = 0; | 167 | $cpt = 0; |
168 | foreach ($data as $link) { | 168 | foreach ($data as $link) { |
169 | $this->assertEquals(self::NB_FIELDS_LINK, count($link)); | 169 | $this->assertEquals(self::NB_FIELDS_LINK, count($link)); |
diff --git a/tests/api/controllers/InfoTest.php b/tests/api/controllers/InfoTest.php index 4beef3f7..5d6a2329 100644 --- a/tests/api/controllers/InfoTest.php +++ b/tests/api/controllers/InfoTest.php | |||
@@ -80,7 +80,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase | |||
80 | $this->assertEquals(200, $response->getStatusCode()); | 80 | $this->assertEquals(200, $response->getStatusCode()); |
81 | $data = json_decode((string) $response->getBody(), true); | 81 | $data = json_decode((string) $response->getBody(), true); |
82 | 82 | ||
83 | $this->assertEquals(8, $data['global_counter']); | 83 | $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, $data['global_counter']); |
84 | $this->assertEquals(2, $data['private_counter']); | 84 | $this->assertEquals(2, $data['private_counter']); |
85 | $this->assertEquals('Shaarli', $data['settings']['title']); | 85 | $this->assertEquals('Shaarli', $data['settings']['title']); |
86 | $this->assertEquals('?', $data['settings']['header_link']); | 86 | $this->assertEquals('?', $data['settings']['header_link']); |
@@ -103,7 +103,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase | |||
103 | $this->assertEquals(200, $response->getStatusCode()); | 103 | $this->assertEquals(200, $response->getStatusCode()); |
104 | $data = json_decode((string) $response->getBody(), true); | 104 | $data = json_decode((string) $response->getBody(), true); |
105 | 105 | ||
106 | $this->assertEquals(8, $data['global_counter']); | 106 | $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, $data['global_counter']); |
107 | $this->assertEquals(2, $data['private_counter']); | 107 | $this->assertEquals(2, $data['private_counter']); |
108 | $this->assertEquals($title, $data['settings']['title']); | 108 | $this->assertEquals($title, $data['settings']['title']); |
109 | $this->assertEquals($headerLink, $data['settings']['header_link']); | 109 | $this->assertEquals($headerLink, $data['settings']['header_link']); |