4242use SimpleSAML \XML \DOMDocumentFactory ;
4343use SimpleSAML \XML \TestUtils \SchemaValidationTestTrait ;
4444use SimpleSAML \XML \TestUtils \SerializableElementTestTrait ;
45- use SimpleSAML \XMLSchema \Type \Base64BinaryValue ;
4645use SimpleSAML \XMLSchema \Type \IDValue ;
4746use SimpleSAML \XMLSchema \Type \IntegerValue ;
48- use SimpleSAML \XMLSchema \Type \NCNameValue ;
4947use SimpleSAML \XMLSchema \Type \NonNegativeIntegerValue ;
5048use SimpleSAML \XMLSchema \Type \QNameValue ;
51- use SimpleSAML \XMLSchema \Type \StringValue ;
5249use SimpleSAML \XMLSecurity \TestUtils \PEMCertificatesMock ;
5350use SimpleSAML \XMLSecurity \XML \ds \KeyInfo ;
5451use SimpleSAML \XMLSecurity \XML \ds \KeyName ;
@@ -192,9 +189,7 @@ public static function tearDownAfterClass(): void
192189 */
193190 public function testMarshalling (): void
194191 {
195- $ assertionIDReference = new AssertionIDReference (
196- NCNameValue::fromString ('_Test ' ),
197- );
192+ $ assertionIDReference = AssertionIDReference::fromString ('_Test ' );
198193
199194 // Create SubjectStatement
200195 $ scd = new SubjectConfirmationData (
@@ -203,17 +198,11 @@ public function testMarshalling(): void
203198
204199 $ keyInfo = new KeyInfo (
205200 [
206- new KeyName (
207- StringValue::fromString ('testkey ' ),
208- ),
201+ KeyName::fromString ('testkey ' ),
209202 new X509Data (
210203 [
211- new X509Certificate (
212- Base64BinaryValue::fromString (self ::$ certificate ),
213- ),
214- new X509SubjectName (
215- StringValue::fromString (self ::$ certData ['name ' ]),
216- ),
204+ X509Certificate::fromString (self ::$ certificate ),
205+ X509SubjectName::fromString (self ::$ certData ['name ' ]),
217206 ],
218207 ),
219208 new Chunk (DOMDocumentFactory::fromString (
@@ -225,12 +214,8 @@ public function testMarshalling(): void
225214
226215 $ sc = new SubjectConfirmation (
227216 [
228- new ConfirmationMethod (
229- SAMLAnyURIValue::fromString ('_Test1 ' ),
230- ),
231- new ConfirmationMethod (
232- SAMLAnyURIValue::fromString ('_Test2 ' ),
233- ),
217+ ConfirmationMethod::fromString ('_Test1 ' ),
218+ ConfirmationMethod::fromString ('_Test2 ' ),
234219 ],
235220 $ scd ,
236221 $ keyInfo ,
@@ -243,25 +228,17 @@ public function testMarshalling(): void
243228 );
244229
245230 $ subject = new Subject ($ sc , $ nameIdentifier );
246- $ audience = new Audience (
247- SAMLAnyURIValue::fromString ('urn:x-simplesamlphp:audience ' ),
248- );
231+ $ audience = Audience::fromString ('urn:x-simplesamlphp:audience ' );
249232 $ subjectStatement = new CustomSubjectStatement ($ subject , [$ audience ]);
250233
251234 // Create AuthenticationStatement
252235 $ keyInfo = new KeyInfo (
253236 [
254- new KeyName (
255- StringValue::fromString ('testkey ' ),
256- ),
237+ KeyName::fromString ('testkey ' ),
257238 new X509Data (
258239 [
259- new X509Certificate (
260- Base64BinaryValue::fromString (self ::$ certificate ),
261- ),
262- new X509SubjectName (
263- StringValue::fromString (self ::$ certData ['name ' ]),
264- ),
240+ X509Certificate::fromString (self ::$ certificate ),
241+ X509SubjectName::fromString (self ::$ certData ['name ' ]),
265242 ],
266243 ),
267244 new Chunk (DOMDocumentFactory::fromString (
@@ -273,12 +250,8 @@ public function testMarshalling(): void
273250
274251 $ sc = new SubjectConfirmation (
275252 [
276- new ConfirmationMethod (
277- SAMLAnyURIValue::fromString ('_Test1 ' ),
278- ),
279- new ConfirmationMethod (
280- SAMLAnyURIValue::fromString ('_Test2 ' ),
281- ),
253+ ConfirmationMethod::fromString ('_Test1 ' ),
254+ ConfirmationMethod::fromString ('_Test2 ' ),
282255 ],
283256 $ scd ,
284257 $ keyInfo ,
@@ -307,17 +280,11 @@ public function testMarshalling(): void
307280 // Create AttributeStatement
308281 $ keyInfo = new KeyInfo (
309282 [
310- new KeyName (
311- StringValue::fromString ('testkey ' ),
312- ),
283+ KeyName::fromString ('testkey ' ),
313284 new X509Data (
314285 [
315- new X509Certificate (
316- Base64BinaryValue::fromString (self ::$ certificate ),
317- ),
318- new X509SubjectName (
319- StringValue::fromString (self ::$ certData ['name ' ]),
320- ),
286+ X509Certificate::fromString (self ::$ certificate ),
287+ X509SubjectName::fromString (self ::$ certData ['name ' ]),
321288 ],
322289 ),
323290 new Chunk (DOMDocumentFactory::fromString (
@@ -329,12 +296,8 @@ public function testMarshalling(): void
329296
330297 $ sc = new SubjectConfirmation (
331298 [
332- new ConfirmationMethod (
333- SAMLAnyURIValue::fromString ('_Test1 ' ),
334- ),
335- new ConfirmationMethod (
336- SAMLAnyURIValue::fromString ('_Test2 ' ),
337- ),
299+ ConfirmationMethod::fromString ('_Test1 ' ),
300+ ConfirmationMethod::fromString ('_Test2 ' ),
338301 ],
339302 $ scd ,
340303 $ keyInfo ,
0 commit comments