Completed
Branch AUTOMATED_TESTING (6eabf7)
by Gordon
14:03
created

MapLayerExtensionTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
class MapLayerExtensionTest extends SapphireTest {
1 ignored issue
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
5
	public function setUp() {
6
		// add MapExtension and MapLayerExtension extension to Member
7
		Member::add_extension('MapExtension');
8
		Member::add_extension('MapLayerExtension');
9
		parent::setUp();
10
	}
11
12
	// check for addition of extra CMS fields
13
	public function testCMSFields() {
14
		$instance = new Member();
15
		$fields = $instance->getCMSFields();
16
		$tab = $fields->findOrMakeTab('Root.MapLayers');
17
		$fields = $tab->FieldList();
18
		$names = array();
19
		foreach ($fields as $field) {
20
			$names[] = $field->getName();
21
		}
22
		$expected = array('Map Layers');
23
		$this->assertEquals($expected, $names);
1 ignored issue
show
Bug introduced by
The method assertEquals() does not seem to exist on object<MapLayerExtensionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
24
	}
25
26
}
27