From 7c57bd95383ec7a7d40735957ea9a792c370b5db Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 4 Jun 2018 18:58:59 +0200 Subject: GetTagsTest - Update to alpha sort for equal occurences --- tests/api/controllers/tags/DeleteTagTest.php | 2 +- tests/api/controllers/tags/GetTagNameTest.php | 2 +- tests/api/controllers/tags/GetTagsTest.php | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/api') diff --git a/tests/api/controllers/tags/DeleteTagTest.php b/tests/api/controllers/tags/DeleteTagTest.php index 7ba5a862..e0787ce2 100644 --- a/tests/api/controllers/tags/DeleteTagTest.php +++ b/tests/api/controllers/tags/DeleteTagTest.php @@ -144,7 +144,7 @@ class DeleteTagTest extends \PHPUnit_Framework_TestCase } /** - * Test DELETE link endpoint: reach not existing ID. + * Test DELETE tag endpoint: reach not existing tag. * * @expectedException Shaarli\Api\Exceptions\ApiTagNotFoundException * @expectedExceptionMessage Tag not found diff --git a/tests/api/controllers/tags/GetTagNameTest.php b/tests/api/controllers/tags/GetTagNameTest.php index d60f5b38..afac228e 100644 --- a/tests/api/controllers/tags/GetTagNameTest.php +++ b/tests/api/controllers/tags/GetTagNameTest.php @@ -112,7 +112,7 @@ class GetTagNameTest extends \PHPUnit_Framework_TestCase } /** - * Test basic getLink service: get non existent link => ApiLinkNotFoundException. + * Test basic getTag service: get non existent tag => ApiTagNotFoundException. * * @expectedException Shaarli\Api\Exceptions\ApiTagNotFoundException * @expectedExceptionMessage Tag not found diff --git a/tests/api/controllers/tags/GetTagsTest.php b/tests/api/controllers/tags/GetTagsTest.php index cf066bc3..3fab31b0 100644 --- a/tests/api/controllers/tags/GetTagsTest.php +++ b/tests/api/controllers/tags/GetTagsTest.php @@ -79,7 +79,7 @@ class GetTagsTest extends \PHPUnit_Framework_TestCase } /** - * Test basic getLinks service: returns all tags. + * Test basic getTags service: returns all tags. */ public function testGetTagsAll() { @@ -102,12 +102,12 @@ class GetTagsTest extends \PHPUnit_Framework_TestCase $this->assertEquals('cartoon', $data[1]['name']); $this->assertEquals(3, $data[1]['occurrences']); // Case insensitive - $this->assertEquals(self::NB_FIELDS_TAG, count($data[2])); - $this->assertEquals('sTuff', $data[2]['name']); - $this->assertEquals(2, $data[2]['occurrences']); + $this->assertEquals(self::NB_FIELDS_TAG, count($data[5])); + $this->assertEquals('sTuff', $data[5]['name']); + $this->assertEquals(2, $data[5]['occurrences']); // End $this->assertEquals(self::NB_FIELDS_TAG, count($data[count($data) - 1])); - $this->assertEquals('ut', $data[count($data) - 1]['name']); + $this->assertEquals('w3c', $data[count($data) - 1]['name']); $this->assertEquals(1, $data[count($data) - 1]['occurrences']); } @@ -181,7 +181,7 @@ class GetTagsTest extends \PHPUnit_Framework_TestCase $data = json_decode((string) $response->getBody(), true); $this->assertEquals(count($tags), count($data)); $this->assertEquals(self::NB_FIELDS_TAG, count($data[0])); - $this->assertEquals('css', $data[0]['name']); + $this->assertEquals('Mercurial', $data[0]['name']); $this->assertEquals(1, $data[0]['occurrences']); } -- cgit v1.2.3