File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace SimpleSAML \Test \XMLSecurity \XML ;
6+
7+ use PHPUnit \Framework \Attributes \Group ;
8+ use PHPUnit \Framework \TestCase ;
9+
10+ use function dirname ;
11+ use function sprintf ;
12+
13+ /**
14+ * Tests for element registry.
15+ *
16+ * @package simplesamlphp/xml-security
17+ */
18+ #[Group('utils ' )]
19+ final class ElementRegistryTest extends TestCase
20+ {
21+ /**
22+ * Test that the class-name can be resolved and it's localname matches.
23+ */
24+ public function testElementRegistry (): void
25+ {
26+ $ elementRegistry = dirname (__FILE__ , 3 ) . '/src/XML/element.registry.php ' ;
27+ $ namespaces = include ($ elementRegistry );
28+
29+ foreach ($ namespaces as $ namespaceURI => $ elements ) {
30+ foreach ($ elements as $ localName => $ fqdn ) {
31+ $ this ->assertTrue (class_exists ($ fqdn ), sprintf ('Class \'%s \' could not be found. ' , $ fqdn ));
32+ $ this ->assertEquals ($ fqdn ::getLocalName (), $ localName );
33+ $ this ->assertEquals ($ fqdn ::getNamespaceURI (), $ namespaceURI );
34+ }
35+ }
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments