Пример #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
 /**
  * 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();
     }
 }
 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
 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'));
 }
 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());
 }