summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-09-23 15:52:50 +0200
committerThomas Tanghus <thomas@tanghus.net>2013-09-23 15:52:50 +0200
commitd27416edf767219f77a828d22bb070345a179631 (patch)
treeee8d3a926326cd35bdcca9485952da899c7b8e24
parent910a0338bb296e2e51d6c9d37d0483f8d05b1c5c (diff)
downloadnextcloud-server-d27416edf767219f77a828d22bb070345a179631.tar.gz
nextcloud-server-d27416edf767219f77a828d22bb070345a179631.zip
Moar tests.
-rw-r--r--tests/lib/tags.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/tags.php b/tests/lib/tags.php
index 92a96a14772..75db9f50f72 100644
--- a/tests/lib/tags.php
+++ b/tests/lib/tags.php
@@ -59,13 +59,14 @@ class Test_Tags extends PHPUnit_Framework_TestCase {
foreach($tags as $tag) {
$result = $tagMgr->add($tag);
+ $this->assertGreaterThan(0, $result, 'add() returned an ID <= 0');
$this->assertTrue((bool)$result);
}
$this->assertFalse($tagMgr->add('Family'));
$this->assertFalse($tagMgr->add('fAMILY'));
- $this->assertEquals(4, count($tagMgr->getTags()));
+ $this->assertCount(4, $tagMgr->getTags(), 'Wrong number of added tags');
}
public function testAddMultiple() {
@@ -85,7 +86,7 @@ class Test_Tags extends PHPUnit_Framework_TestCase {
$this->assertTrue($tagMgr->hasTag($tag));
}
- $this->assertEquals(4, count($tagMgr->getTags()));
+ $this->assertCount(4, $tagMgr->getTags(), 'Not all tags added');
}
public function testIsEmpty() {
@@ -94,7 +95,10 @@ class Test_Tags extends PHPUnit_Framework_TestCase {
$this->assertEquals(0, count($tagMgr->getTags()));
$this->assertTrue($tagMgr->isEmpty());
- $this->assertNotEquals(false, $tagMgr->add('Tag'));
+
+ $result = $tagMgr->add('Tag');
+ $this->assertGreaterThan(0, $result, 'add() returned an ID <= 0');
+ $this->assertNotEquals(false, $result, 'add() returned false');
$this->assertFalse($tagMgr->isEmpty());
}