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 2
2
3
3
namespace Safe ;
4
4
5
- use const E_WARNING ;
6
- use function error_reporting ;
7
5
use PHPUnit \Framework \TestCase ;
8
6
use function restore_error_handler ;
9
7
use Safe \Exceptions \StringsException ;
8
+ use SimpleXMLElement ;
10
9
11
10
/**
12
11
* This test must be called AFTER generation of files has occurred
@@ -47,4 +46,25 @@ public function testPregMatch()
47
46
\preg_match ($ spotifyRegex , $ url , $ originalMatches );
48
47
$ this ->assertSame ($ originalMatches , $ matches );
49
48
}
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
+ }
50
70
}
You can’t perform that action at this time.
0 commit comments