From 53d5ccd9af9db842fbe09a24a48f10458b7f0711 Mon Sep 17 00:00:00 2001 From: Konrad Abicht Date: Wed, 5 Jun 2024 10:03:50 +0200 Subject: [PATCH] ElementStringTest: added further tests, ... ... which fail (mostly) without the fixes in this branch. --- .../Integration/Element/ElementStringTest.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/PHPUnit/Integration/Element/ElementStringTest.php b/tests/PHPUnit/Integration/Element/ElementStringTest.php index 032214b8..8207426f 100644 --- a/tests/PHPUnit/Integration/Element/ElementStringTest.php +++ b/tests/PHPUnit/Integration/Element/ElementStringTest.php @@ -140,6 +140,29 @@ public function testParseIssue715(): void { $element = ElementString::parse('(())'); $this->assertEquals('()', $element->getContent()); + + // source: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.7old.pdf + // page 54 + $string = '(Strings may contain balanced parentheses ( ) and +special characters (*!&}^% and so on).)'; + $element = ElementString::parse($string); + $this->assertEquals('Strings may contain balanced parentheses ( ) and +special characters (*!&}^% and so on).', $element->getContent()); + + // source: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.7old.pdf + // page 55 + $string = '( This string has an end−of−line at the end of it. +)'; + $element = ElementString::parse($string); + $this->assertEquals(' This string has an end−of−line at the end of it.'.\PHP_EOL, $element->getContent()); + + // source: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.7old.pdf + // page 55 + $string = '( These \ +two strings \ +are the same.)'; + $element = ElementString::parse($string); + $this->assertEquals(' These two strings are the same.', $element->getContent()); } public function testGetContent(): void