Code Duplication    Length = 10-10 lines in 2 locations

tests/SectionIOTest.php 2 locations

@@ 46-55 (lines=10) @@
43
44
        // Copy test images for each of the fixture references
45
        $imageIDs = $this->allFixtureIDs('Image');
46
        foreach ($imageIDs as $imageID) {
47
            $image = DataObject::get_by_id('Image', $imageID);
48
            $filePath = BASE_PATH."/$image->Filename";
49
            $sourcePath = str_replace('assets/SectionTest/', 'section-io/tests/testfiles/', $filePath);
50
            if (!file_exists($filePath)) {
51
                if (!copy($sourcePath, $filePath)) {
52
                    user_error('Failed to copy test images', E_USER_ERROR);
53
                }
54
            }
55
        }
56
57
        // Copy test files for each of the fixture references
58
        $fileIDs = $this->allFixtureIDs('File');
@@ 59-68 (lines=10) @@
56
57
        // Copy test files for each of the fixture references
58
        $fileIDs = $this->allFixtureIDs('File');
59
        foreach ($fileIDs as $fileID) {
60
            $file = DataObject::get_by_id('File', $fileID);
61
            $filePath = BASE_PATH."/$file->Filename";
62
            $sourcePath = str_replace('assets/SectionTest/', 'section-io/tests/testfiles/', $filePath);
63
            if (!file_exists($filePath)) {
64
                if (!copy($sourcePath, $filePath)) {
65
                    user_error('Failed to copy test files', E_USER_ERROR);
66
                }
67
            }
68
        }
69
    }
70
71
    public function tearDownOnce()