Example #1
0
 public function testValid()
 {
     $option = new Option();
     $requestOption = new Option\Request();
     $paperOption = new Option\Request\Paper();
     $paperOption->setStampAdjust(true);
     $requestOption->setPaperOption($paperOption);
     $option->setRequestOption($requestOption);
     $documentOption = new Option\Document();
     $documentOption->setId(1);
     $paperOption = new Option\Document\Paper();
     $paperOption->setStaple(true);
     $documentOption->setPaperOption($paperOption);
     $option->addDocumentOptions($documentOption);
     $pageOption = new Element\Option\Page();
     $pageOption->setId(1);
     $paperOption = new Option\Page\Paper();
     $paperOption->setBackgroundId(1);
     $pageOption->setPaperOption($paperOption);
     $option->addPageOptions($pageOption);
     $option->verify();
 }
Example #2
0
 protected function getValidRequest()
 {
     $request = new Request();
     $request->setMediaType(Request::PAPER);
     $request->setTrackId('234');
     //RECIPIENTS
     $recipient1 = RecipientTest::getValidRecipient(0);
     $recipient2 = RecipientTest::getValidRecipient(1);
     $request->addRecipient($recipient1);
     $request->addRecipient($recipient2);
     //DOCUMENTS
     $document1 = DocumentTest::getValidDocument(0);
     $document2 = DocumentTest::getValidDocument(1);
     $request->addDocumentData($document1);
     $request->addDocumentData($document2);
     //FOLDS
     $fold = new Fold();
     $fold->setTrackId('xsx');
     $fold->setId('1');
     $fold->setRecipientId($recipient1->getId());
     #Doc
     $docInFold = new DocInFold();
     $docInFold->setDocumentId($document1->getId());
     $docInFold->setFirstPage(2);
     $pageInDoc = new PageInDoc();
     $pageInDoc->setNumber(2);
     $pageInDoc->setPageOptionId('134');
     $docInFold->addPage($pageInDoc);
     $stapling = new Stapling();
     $stapling->setFirstPageOffset(1);
     $stapling->setLastPageOffset(3);
     $docInFold->addStaplingDetails($stapling);
     $fold->addDocument($docInFold);
     $docInFold = new DocInFold();
     $docInFold->setDocumentId($document2->getId());
     $fold->addDocument($docInFold);
     $request->addFold($fold);
     //OPTION
     $option = new Option();
     #request
     $optionPaper = new Option\Request\Paper();
     $optionPaper->setRemoveInvalidReturnEnvelope(true);
     $optionPaper->setStampAdjust(true);
     $optionRequest = new Option\Request();
     $optionRequest->setPaperOption($optionPaper);
     $option->setRequestOption($optionRequest);
     #document
     $optionPaperPage = new Option\Page\Paper();
     $optionPaperPage->setBackgroundId(1);
     $insertId = new Option\Page\InsertPageId();
     $insertId->setValue('134');
     $insertId->setType(Option\Page\InsertPageId::INSERTPAGEID_TYPE_RV);
     $optionPaperPage->setInsertPageId($insertId);
     $optionPaper = new Option\Document\Paper();
     $optionPaper->setPageOption($optionPaperPage);
     $optionPaper->setStaple(true);
     $optionDocument = new Option\Document();
     $optionDocument->setPaperOption($optionPaper);
     $optionDocument->setId(1);
     $option->addDocumentOptions($optionDocument);
     #page
     $optionPage = new Option\Page();
     $optionPage->setPaperOption($optionPaperPage);
     $optionPage->setId(1);
     $option->addPageOptions($optionPage);
     $request->setOptions($option);
     return $request;
 }