Code Duplication    Length = 7-13 lines in 3 locations

tests/unit/ControllerAnnotatorTest.php 2 locations

@@ 45-54 (lines=10) @@
42
        $this->permissionChecker = Injector::inst()->get(AnnotatePermissionChecker::class);
43
    }
44
45
    public function testPageGetsAnnotated()
46
    {
47
        $classInfo = new AnnotateClassInfo(AnnotatorPageTest::class);
48
        $filePath = $classInfo->getClassFilePath();
49
50
        $content = $this->annotator->getGeneratedFileContent(file_get_contents($filePath), AnnotatorPageTest::class);
51
52
        $this->assertContains(' * Class \SilverLeague\IDEAnnotator\Tests\AnnotatorPageTest', $content);
53
        $this->assertContains('@property string $SubTitle', $content);
54
    }
55
56
    public function testPageControllerGetsAnnotator()
57
    {
@@ 76-88 (lines=13) @@
73
    /**
74
     * Test the generation of annotations for an Extension
75
     */
76
    public function testAnnotateControllerExtension()
77
    {
78
        $classInfo = new AnnotateClassInfo(AnnotatorPageTest_Extension::class);
79
        $filePath = $classInfo->getClassFilePath();
80
        $original = file_get_contents($filePath);
81
        $annotated = $this->annotator->getGeneratedFileContent($original, AnnotatorPageTest_Extension::class);
82
83
        $this->assertContains(' * Class \SilverLeague\IDEAnnotator\Tests\AnnotatorPageTest_Extension', $annotated);
84
        $this->assertContains(
85
            '@property \SilverLeague\IDEAnnotator\Tests\AnnotatorPageTestController|\SilverLeague\IDEAnnotator\Tests\AnnotatorPageTest_Extension $owner',
86
            $annotated
87
        );
88
    }
89
90
    public function tearDown()
91
    {

tests/unit/DataObjectAnnotatorTest.php 1 location

@@ 205-211 (lines=7) @@
202
    /**
203
     * Test that root (non-namespaced) classes get annotated
204
     */
205
    public function testRootAnnotations()
206
    {
207
        $classInfo = new AnnotateClassInfo(RootTeam::class);
208
        $filePath = $classInfo->getClassFilePath();
209
        $run = $this->annotator->getGeneratedFileContent(file_get_contents($filePath), RootTeam::class);
210
        $this->assertContains('@property string $Title', $run);
211
    }
212
213
    /**
214
     * Test the generation of annotations for a DataExtension