Skip to content

Commit f6e2069

Browse files
committed
Adding failing test
1 parent fe4da23 commit f6e2069

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

generator/tests/GeneratedFilesTest.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace Safe;
44

5-
use const E_WARNING;
6-
use function error_reporting;
75
use PHPUnit\Framework\TestCase;
86
use function restore_error_handler;
97
use 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
}

0 commit comments

Comments
 (0)