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() {
$this->assertTrue($tagMgr->hasTag($tag));
}
- $this->assertEquals(4, count($tagMgr->getTags()));
+ $this->assertCount(4, $tagMgr->getTags(), 'Not all tags added');
}
public function testIsEmpty() {
$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());
}