Code Duplication    Length = 10-10 lines in 2 locations

tests/DMSDocumentSetTest.php 1 location

@@ 10-19 (lines=10) @@
7
    /**
8
     * Ensure that getDocuments is extensible
9
     */
10
    public function testGetDocumentsIsExtensible()
11
    {
12
        DMSDocumentSet::add_extension('StubRelatedDocumentExtension');
13
14
        $set = new DMSDocumentSet;
15
        $documents = $set->getDocuments();
16
17
        $this->assertCount(1, $documents);
18
        $this->assertSame('Extended', $documents->first()->Filename);
19
    }
20
21
    /**
22
     * Test that the GridField for documents isn't shown until you've saved the set

tests/DMSDocumentTest.php 1 location

@@ 35-44 (lines=10) @@
32
    /**
33
     * Test the extensibility of getRelatedDocuments
34
     */
35
    public function testGetRelatedDocumentsIsExtensible()
36
    {
37
        DMSDocument::add_extension('StubRelatedDocumentExtension');
38
39
        $emptyDocument = new DMSDocument;
40
        $relatedDocuments = $emptyDocument->getRelatedDocuments();
41
42
        $this->assertCount(1, $relatedDocuments);
43
        $this->assertSame('Extended', $relatedDocuments->first()->Filename);
44
    }
45
46
    /**
47
     * Ensure that the DMS Document CMS actions contains a grid field for managing related documents