assertTrue($stringObj instanceof Zend_Pdf_Element_String); } public function testGetType() { $stringObj = new Zend_Pdf_Element_String('some text'); $this->assertEquals($stringObj->getType(), Zend_Pdf_Element::TYPE_STRING); } public function testToString() { $stringObj = new Zend_Pdf_Element_String('some text ()'); $this->assertEquals($stringObj->toString(), '(some text \\(\\))' ); } public function testEscape() { $this->assertEquals(Zend_Pdf_Element_String::escape("\n\r\t\x08\x0C()\\"), "\\n\\r\\t\\b\\f\\(\\)\\\\"); } public function testUnescape() { $this->assertEquals(Zend_Pdf_Element_String::unescape("\\n\\r\\t\\b\\f\\(\\)\\\\ \nsome \\\ntext"), "\n\r\t\x08\x0C()\\ \nsome text"); } /** * @group ZF-9450 */ public function testUnescapeOctal() { $input = array( 0304 => '\\304', 0326 => '\\326', 0334 => '\\334' ); foreach ($input as $k => $v) { $this->assertEquals(Zend_Pdf_Element_String::unescape($v), chr($k), 'expected German Umlaut'); } } }