Code Duplication    Length = 15-16 lines in 5 locations

tests/LightSaml/Tests/Validator/Model/NameId/NameIdValidatorTest.php 5 locations

@@ 258-272 (lines=15) @@
255
        $this->assertTrue(true);
256
    }
257
258
    public function test_invalid_entity_format_with_name_qualifier()
259
    {
260
        $this->expectExceptionMessage("NameID with Entity Format attribute MUST NOT set the NameQualifier attribute");
261
        $this->expectException(\LightSaml\Error\LightSamlValidationException::class);
262
        $nameId = new NameID();
263
        $nameId->setFormat(SamlConstants::NAME_ID_FORMAT_ENTITY)
264
            ->setValue('some:entity')
265
            ->setNameQualifier('name:qualifier');
266
267
        $validator = new NameIdValidator();
268
269
        $validator->validateNameId($nameId);
270
271
        $this->assertTrue(true);
272
    }
273
274
    public function test_invalid_entity_format_with_sp_name_qualifier()
275
    {
@@ 274-288 (lines=15) @@
271
        $this->assertTrue(true);
272
    }
273
274
    public function test_invalid_entity_format_with_sp_name_qualifier()
275
    {
276
        $this->expectExceptionMessage("NameID with Entity Format attribute MUST NOT set the SPNameQualifier attribute");
277
        $this->expectException(\LightSaml\Error\LightSamlValidationException::class);
278
        $nameId = new NameID();
279
        $nameId->setFormat(SamlConstants::NAME_ID_FORMAT_ENTITY)
280
            ->setValue('some:entity')
281
            ->setSPNameQualifier('sp:name:qualifier');
282
283
        $validator = new NameIdValidator();
284
285
        $validator->validateNameId($nameId);
286
287
        $this->assertTrue(true);
288
    }
289
290
    public function test_invalid_entity_format_with_sp_provided_id()
291
    {
@@ 290-304 (lines=15) @@
287
        $this->assertTrue(true);
288
    }
289
290
    public function test_invalid_entity_format_with_sp_provided_id()
291
    {
292
        $this->expectExceptionMessage("NameID with Entity Format attribute MUST NOT set the SPProvidedID attribute");
293
        $this->expectException(\LightSaml\Error\LightSamlValidationException::class);
294
        $nameId = new NameID();
295
        $nameId->setFormat(SamlConstants::NAME_ID_FORMAT_ENTITY)
296
            ->setValue('some:entity')
297
            ->setSPProvidedID('sp:provided:id');
298
299
        $validator = new NameIdValidator();
300
301
        $validator->validateNameId($nameId);
302
303
        $this->assertTrue(true);
304
    }
305
306
    public function test_valid_persistent_format()
307
    {
@@ 319-334 (lines=16) @@
316
        $this->assertTrue(true);
317
    }
318
319
    public function test_valid_persistent_format_with_other_attributes()
320
    {
321
        $nameId = new NameID();
322
        $nameId->setFormat(SamlConstants::NAME_ID_FORMAT_PERSISTENT)
323
            ->setValue('12345678')
324
            ->setSPProvidedID('sp:provided:id')
325
            ->setSPNameQualifier('sp:name:qualifier')
326
            ->setNameQualifier('name:qualifier')
327
        ;
328
329
        $validator = new NameIdValidator();
330
331
        $validator->validateNameId($nameId);
332
333
        $this->assertTrue(true);
334
    }
335
336
    public function test_invalid_persistent_format_empty()
337
    {
@@ 378-393 (lines=16) @@
375
        $this->assertTrue(true);
376
    }
377
378
    public function test_valid_transient_format_with_other_attributes()
379
    {
380
        $nameId = new NameID();
381
        $nameId->setFormat(SamlConstants::NAME_ID_FORMAT_TRANSIENT)
382
            ->setValue('1234567890123456')
383
            ->setSPProvidedID('sp:provided:id')
384
            ->setSPNameQualifier('sp:name:qualifier')
385
            ->setNameQualifier('name:qualifier')
386
        ;
387
388
        $validator = new NameIdValidator();
389
390
        $validator->validateNameId($nameId);
391
392
        $this->assertTrue(true);
393
    }
394
395
    public function test_invalid_transient_format_empty()
396
    {