File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 22
33namespace Safe ;
44
5- use const E_WARNING ;
6- use function error_reporting ;
75use PHPUnit \Framework \TestCase ;
86use function restore_error_handler ;
97use Safe \Exceptions \StringsException ;
8+ use SimpleXMLElement ;
109
1110/**
1211 * This test must be called AFTER generation of files has occurred
@@ -47,4 +46,25 @@ public function testPregMatch()
4746 \preg_match ($ spotifyRegex , $ url , $ originalMatches );
4847 $ this ->assertSame ($ originalMatches , $ matches );
4948 }
49+
50+ public function testObjects ()
51+ {
52+ require_once __DIR__ .'/../../generated/simplexml.php ' ;
53+ require_once __DIR__ .'/../../lib/Exceptions/SafeExceptionInterface.php ' ;
54+ require_once __DIR__ .'/../../lib/Exceptions/AbstractSafeException.php ' ;
55+ require_once __DIR__ .'/../../generated/Exceptions/SimplexmlException.php ' ;
56+
57+ $ xmlStr = <<<XML
58+ <?xml version='1.0' standalone='yes'?>
59+ <movies>
60+ <movie>
61+ <title>PHP: Behind the Parser</title>
62+ </movie>
63+ </movies>
64+ XML ;
65+
66+ $ movies = simplexml_load_string ($ xmlStr );
67+
68+ $ this ->assertInstanceOf (SimpleXMLElement::class, $ movies );
69+ }
5070}
You can’t perform that action at this time.
0 commit comments