Exemplo n.º 1
0
 public function testDelTag()
 {
     $db = Zend_Registry::get('db');
     $new_tag_id = Zend_Registry::get('new_tag_id');
     $new_note_id = Zend_Registry::get('new_note_id');
     $tag_name = Zend_Registry::get('tag_name');
     $note = new Database_Notes($db);
     $note->load($new_note_id);
     //删除由之前单元中创建个tag
     $note->delTag($tag_name);
     //reload,以确保刚才的删除正常
     $note->load($new_note_id);
     $my_tags = $note->getJoinRow('tag');
     $tag_is_gone = in_array($new_tag_id, $my_tags);
     $this->assertFalse($tag_is_gone);
 }