示例#1
0
 /**
  * @depends testAddToCategory
  */
 public function testRemoveFromCategory()
 {
     $objids = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
     // Is this "legal"?
     $this->testAddToCategory();
     $catmgr = new OC_VCategories($this->objectType, $this->user);
     foreach ($objids as $id) {
         $this->assertTrue(in_array($id, $catmgr->idsForCategory('Family')));
         $catmgr->removeFromCategory($id, 'Family');
         $this->assertFalse(in_array($id, $catmgr->idsForCategory('Family')));
     }
     $this->assertEqual(1, count($catmgr->categories()));
     $this->assertEqual(0, count($catmgr->idsForCategory('Family')));
 }