GetTagsTest - Update to alpha sort for equal occurences

This commit is contained in:
ArthurHoaro 2018-06-04 18:58:59 +02:00
parent d3f42ca487
commit 7c57bd9538
3 changed files with 8 additions and 8 deletions

View 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

View 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

View 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']);
}