예제 #1
0
 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) {
     }
 }
예제 #2
0
 /** @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);
 }