コード例 #1
0
 public function testTranslationOfOpusNoteFields()
 {
     $model = new Opus_Note();
     $fieldNames = $model->describe();
     foreach ($fieldNames as $name) {
         $key = $this->helper->getKeyForField('Opus_Note', $name);
         $this->assertTrue($this->translate->isTranslated($key), 'Translation key \'' . $key . '\' is missing.');
     }
 }
コード例 #2
0
ファイル: Deposit.php プロジェクト: belapp/opus4-application
 /**
  * Store a note in the current document
  * @param type $dataValue Note text
  */
 private function storeNoteObject($dataValue)
 {
     $note = new Opus_Note();
     $note->setMessage($dataValue);
     $note->setVisibility("private");
     try {
         $this->_document->addNote($note);
     } catch (Opus_Model_Exception $e) {
         $this->_log->err("could not add note with message {$dataValue} to document " . $this->_docId . " : " . $e->getMessage());
         throw new Publish_Model_Exception();
     }
 }
コード例 #3
0
 public function testPreserveNewlinesForNote()
 {
     $this->markTestIncomplete("Muss fuer OPUS 4.4 angepasst werden.");
     // TODO OPUSVIER-2794
     $doc = $this->createTestDocument();
     $doc->setLanguage("eng");
     $doc->setServerState("published");
     $note = new Opus_Note();
     $note->setMessage("foo\nbar\n\nbaz");
     $note->setVisibility("public");
     $doc->addNote($note);
     $doc->store();
     $this->dispatch('/admin/document/index/id/' . $doc->getId());
     $this->assertContains('<pre class="preserve-spaces noteTextContainer">' . "foo\nbar\n\nbaz" . '</pre>', $this->getResponse()->getBody());
 }
コード例 #4
0
ファイル: NoteTest.php プロジェクト: belapp/opus4-application
 public function testPrepareRenderingAsView()
 {
     $form = new Admin_Form_Document_Note();
     $note = new Opus_Note();
     $note->setMessage('Message1');
     $note->setVisibility('public');
     $form->populateFromModel($note);
     $form->prepareRenderingAsView();
     $this->assertFalse($form->getElement('Visibility')->getDecorator('Label'));
 }
コード例 #5
0
 public function testNotePerserveSpace()
 {
     $doc = $this->createTestDocument();
     $doc->setLanguage("eng");
     $doc->setServerState("published");
     $note = new Opus_Note();
     $note->setMessage("foo\nbar\n\nbaz");
     $note->setVisibility("public");
     $doc->addNote($note);
     $doc->store();
     $this->dispatch('/frontdoor/index/index/docId/' . $doc->getId());
     $this->assertContains('<pre class="preserve-spaces">' . "foo\nbar\n\nbaz</pre>", $this->getResponse()->getBody());
 }