コード例 #1
0
ファイル: VoxbItemTest.php プロジェクト: cableman/ereolen
 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);
         }
     }
 }
コード例 #2
0
ファイル: VoxbTagTest.php プロジェクト: cableman/ereolen
 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);
 }