55namespace SimpleSAML \XMLSecurity \Test \XML \ds ;
66
77use DOMDocument ;
8+ use PHPUnit \Framework \TestCase ;
89use SimpleSAML \Assert \AssertionFailedException ;
9- use SimpleSAML \Test \XML \SerializableXMLTest ;
10+ use SimpleSAML \Test \XML \SerializableXMLTestTrait ;
1011use SimpleSAML \XML \DOMDocumentFactory ;
1112use SimpleSAML \XML \Chunk ;
1213use SimpleSAML \XMLSecurity \XML \ds \KeyName ;
2526 *
2627 * @package simplesamlphp/xml-security
2728 */
28- final class KeyInfoTest extends SerializableXMLTest
29+ final class KeyInfoTest extends TestCase
2930{
31+ use SerializableXMLTestTrait;
32+
3033 /** @var string */
3134 private string $ certificate ;
3235
@@ -38,9 +41,9 @@ final class KeyInfoTest extends SerializableXMLTest
3841 */
3942 public function setUp (): void
4043 {
41- self :: $ element = KeyInfo::class;
44+ $ this -> testedClass = KeyInfo::class;
4245
43- self :: $ xmlRepresentation = DOMDocumentFactory::fromFile (
46+ $ this -> xmlRepresentation = DOMDocumentFactory::fromFile (
4447 dirname (dirname (dirname (dirname (__FILE__ )))) . '/tests/resources/xml/ds_KeyInfo.xml '
4548 );
4649
@@ -99,7 +102,7 @@ public function testMarshalling(): void
99102 $ this ->assertInstanceOf (Chunk::class, $ info [3 ]);
100103 $ this ->assertEquals ('abc123 ' , $ keyInfo ->getId ());
101104
102- $ this ->assertEquals (self :: $ xmlRepresentation ->saveXML (self :: $ xmlRepresentation ->documentElement ), strval ($ keyInfo ));
105+ $ this ->assertEquals ($ this -> xmlRepresentation ->saveXML ($ this -> xmlRepresentation ->documentElement ), strval ($ keyInfo ));
103106 }
104107
105108
@@ -118,7 +121,7 @@ public function testMarshallingEmpty(): void
118121 */
119122 public function testUnmarshalling (): void
120123 {
121- $ keyInfo = KeyInfo::fromXML (self :: $ xmlRepresentation ->documentElement );
124+ $ keyInfo = KeyInfo::fromXML ($ this -> xmlRepresentation ->documentElement );
122125 $ this ->assertEquals ('abc123 ' , $ keyInfo ->getId ());
123126
124127 $ info = $ keyInfo ->getInfo ();
0 commit comments