public function testTagsList() { $obj = new VoxbItem(); $obj->fetchByFaust('111111111'); $this->assertNotNull($obj->getTags()); $this->assertEquals($obj->getTags()->getCount(), 4); $tags = $obj->getTags()->toArray(); $this->assertTrue(is_array($tags)); $this->assertEquals(4, count($tags)); foreach ($obj->getTags() as $v) { if ($v->getName() == 'tag4') { $this->assertEquals($v->getCount(), 3); } elseif ($v->getName() == 'tag1') { $this->assertEquals($v->getCount(), 2); } else { $this->assertEquals($v->getCount(), 1); } } }
public function testUpdateTag() { $obj = VoxbBase::getInstance(); $profile = new VoxbProfile(); $profile->setUserId($this->users[0]); $profile->fetchMyData(); // add a new tag (and keep old tags) $tag = new VoxbTagRecord(); $this->assertTrue($tag->create('111111111', 'tag_new', $profile)); $item = new VoxbItem(); $item->fetchByFaust('111111111'); $this->assertEquals($item->getTags()->getCount(), 5); }