public function testNumAttachments() { $item = new Zotero_Item(); $item->libraryID = self::$config['userLibraryID']; $item->itemTypeID = Zotero_ItemTypes::getID("book"); $item->save(); $this->assertEquals(0, $item->numAttachments()); $attachmentItem = new Zotero_Item(); $attachmentItem->libraryID = self::$config['userLibraryID']; $attachmentItem->itemTypeID = Zotero_ItemTypes::getID("attachment"); $attachmentItem->setSource($item->id); $attachmentItem->save(); $this->assertEquals(1, $item->numAttachments()); }