]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
GetTagsTest - Update to alpha sort for equal occurences
authorArthurHoaro <arthur@hoa.ro>
Mon, 4 Jun 2018 16:58:59 +0000 (18:58 +0200)
committerArthurHoaro <arthur@hoa.ro>
Thu, 5 Jul 2018 18:45:03 +0000 (20:45 +0200)
tests/api/controllers/tags/DeleteTagTest.php
tests/api/controllers/tags/GetTagNameTest.php
tests/api/controllers/tags/GetTagsTest.php

index 7ba5a862bffd642eb0a63e71bf98e69f34a8ee9a..e0787ce2cfa213f356e6a770f1875fc24364e73f 100644 (file)
@@ -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
index d60f5b389d733e6436711b97f8d0b6498319df00..afac228e26b23e0ad74037c105e69a5a4b49a67c 100644 (file)
@@ -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
index cf066bc348d1d46f513fdb1d5caa34af17c5b541..3fab31b0f462a3ee335b9429240e65919a745e68 100644 (file)
@@ -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']);
     }