예제 #1
0
    function testPrependsSimpleText()
    {
        $startNote = '\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 Arial;}{\\f1\\fnil\\fcharset0 Microsoft Sans Serif;}}
{\\colortbl ;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}
\\viewkind4\\uc1\\pard\\cf1\\ul\\b\\f0\\fs17 4/2/2013 9:49:38 AM - bglass: test.\\par
3/29/2013 2:19:29 PM - gviguet:  l/vm in re to Counseling..............\\par';
        $note = new JoshRibakoff_Note();
        $note->setRTF($startNote);
        $note->prependNote(array('text' => 'simple note2'));
        $expectedNote = '\\rtf1\\ansi\\ansicpg1251\\deff0\\deflang1049{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 Arial;}{\\f1\\fnil\\fcharset0 Microsoft Sans Serif;}}
{\\colortbl \\red0\\green0\\blue0;\\red255\\green0\\blue0;\\red0\\green0\\blue255;}
\\f0\\fs17 simple note2\\par
\\viewkind4\\uc1\\pard\\cf1\\ul\\b\\f0\\fs17 4/2/2013 9:49:38 AM - bglass: test.\\par
3/29/2013 2:19:29 PM - gviguet:  l/vm in re to Counseling..............\\par';
        $this->assertEquals($expectedNote, $note->formatRTF(), 'should prepend note & format as RTF');
    }
예제 #2
0
파일: NoteTest.php 프로젝트: alipek/rtf
   function testPrependedNoteShouldBeInPlaintext()
   {
       $startNote = '{\\rtf1\\ansi\\ansicpg1251\\deff0\\deflang1049{\\fonttbl{\\f0\\fnil\\fcharset0 Microsoft Sans Serif;}{\\f1\\fnil\\fcharset204 Microsoft Sans Serif;}}
\uc1\\pard\\f0\\fs17 10/6/2011 6:42:52 PM - kackermann: \\par
\cf2\\b 10/4/2011 1:06:03 PM - jhorton: TURNED ACH OFF PERM IN ACCI PER ACH FORM}';
       $note = new JoshRibakoff_Note();
       $note->setRTF($startNote);
       $note->prependNote(array('text' => 'new note'));
       $expectedNote = "new note\n";
       $expectedNote .= "10/6/2011 6:42:52 PM - kackermann:\n";
       $expectedNote .= "10/4/2011 1:06:03 PM - jhorton: TURNED ACH OFF PERM IN ACCI PER ACH FORM\n";
       $this->assertEquals($expectedNote, $note->formatPlaintext(), 'prepended note should be in the plaintext output');
   }