/**
  * @expectedException RackTablesError
  */
 public function testCreateCircularReference()
 {
     // set A as the parent of B, and B as the parent of C
     commitUpdateTag($this->tagb_id, 'unit test tag b', $this->taga_id, 'yes');
     commitUpdateTag($this->tagc_id, 'unit test tag c', $this->tagb_id, 'yes');
     // setting C as the parent of A should fail
     commitUpdateTag($this->taga_id, 'unit test tag a', $this->tagc_id, 'yes');
 }
Пример #2
0
function updateTag()
{
    assertUIntArg('tag_id');
    genericAssertion('tag_name', 'tag');
    assertUIntArg('parent_id', TRUE);
    genericAssertion('is_assignable', 'enum/yesno');
    commitUpdateTag($_REQUEST['tag_id'], $_REQUEST['tag_name'], $_REQUEST['parent_id'], $_REQUEST['is_assignable']);
    showSuccess('Tag updated successfully');
}