Skip to content

Commit

Permalink
ElementStringTest: added further tests, ...
Browse files Browse the repository at this point in the history
... which fail (mostly) without the fixes in this branch.
  • Loading branch information
k00ni committed Jun 5, 2024
1 parent e738b8e commit 53d5ccd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/PHPUnit/Integration/Element/ElementStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53d5ccd

Please sign in to comment.