Code Duplication    Length = 12-12 lines in 2 locations

tests/php/PHPMD/RuleSetFactoryTest.php 2 locations

@@ 585-596 (lines=12) @@
582
     * @return void
583
     * @covers \PHPMD\RuleClassFileNotFoundException
584
     */
585
    public function testCreateRuleSetsThrowsExceptionWhenClassFileNotInIncludePath()
586
    {
587
        $fileName = self::createFileUri('rulesets/set-class-file-not-found.xml');
588
        $factory  = new RuleSetFactory();
589
590
        $this->setExpectedException(
591
            RuleClassFileNotFoundException::class,
592
            'Cannot load source file for class: PHPMD\\Stubs\\ClassFileNotFoundRule'
593
        );
594
595
        $factory->createRuleSets($fileName);
596
    }
597
598
    /**
599
     * Tests that the factory throws the expected exception when a rule class
@@ 605-616 (lines=12) @@
602
     * @return void
603
     * @covers \PHPMD\RuleClassNotFoundException
604
     */
605
    public function testCreateRuleSetThrowsExceptionWhenFileNotContainsClass()
606
    {
607
        $fileName = self::createFileUri('rulesets/set-class-not-found.xml');
608
        $factory  = new RuleSetFactory();
609
610
        $this->setExpectedException(
611
            RuleClassNotFoundException::class,
612
            'Cannot find rule class: PHPMD\\Stubs\\ClassNotFoundRule'
613
        );
614
615
        $factory->createRuleSets($fileName);
616
    }
617
618
    /**
619
     * Tests that the factory throws the expected exception when a rule class