public function testAddInvalidDocument() { $mgr = new AfsDocumentManager(); try { $mgr->add_document(new AfsDocument()); $this->fail('Should have failed due to invalid document provided'); } catch (InvalidArgumentException $e) { } }
/** @brief Upload one document to the PaF. * * @param $doc [in] simple document (see @a AfsDocument). * @param $comment [in] comment associated to this action (default=null). * @return command result (see @a AfsPafUploadReply). * * @exception see @a upload_docs method. */ public function upload_doc(AfsDocument $doc, $comment = null, $paf_mode = PaFMode::Incremental) { $mgr = new AfsDocumentManager(); $mgr->add_document($doc); return $this->upload_docs($mgr, $comment, $paf_mode); }