Code Duplication    Length = 15-17 lines in 2 locations

tests/forms/HtmlEditorFieldTest.php 1 location

@@ 21-35 (lines=15) @@
18
19
	protected $extraDataObjects = array('HtmlEditorFieldTest_Object');
20
21
	public function setUp() {
22
		parent::setUp();
23
24
		// Set backend root to /HtmlEditorFieldTest
25
		AssetStoreTest_SpyStore::activate('HtmlEditorFieldTest');
26
27
		// Create a test files for each of the fixture references
28
		$files = File::get()->exclude('ClassName', 'Folder');
29
		foreach($files as $file) {
30
			$fromPath = BASE_PATH . '/framework/tests/forms/images/' . $file->Name;
31
			$destPath = AssetStoreTest_SpyStore::getLocalPath($file); // Only correct for test asset store
32
			SS_Filesystem::makeFolder(dirname($destPath));
33
			copy($fromPath, $destPath);
34
		}
35
	}
36
37
	public function tearDown() {
38
		AssetStoreTest_SpyStore::reset();

tests/model/DataDifferencerTest.php 1 location

@@ 19-35 (lines=17) @@
16
		'DataDifferencerTest_HasOneRelationObject'
17
	);
18
19
	public function setUp() {
20
		parent::setUp();
21
22
		Versioned::set_stage(Versioned::DRAFT);
23
24
		// Set backend root to /DataDifferencerTest
25
		AssetStoreTest_SpyStore::activate('DataDifferencerTest');
26
27
		// Create a test files for each of the fixture references
28
		$files = File::get()->exclude('ClassName', 'Folder');
29
		foreach($files as $file) {
30
			$fromPath = BASE_PATH . '/framework/tests/model/testimages/' . $file->Name;
31
			$destPath = AssetStoreTest_SpyStore::getLocalPath($file); // Only correct for test asset store
32
			SS_Filesystem::makeFolder(dirname($destPath));
33
			copy($fromPath, $destPath);
34
		}
35
	}
36
37
	public function tearDown() {
38
		AssetStoreTest_SpyStore::reset();