Completed
Branch AUTOMATED_TESTING (4870f5)
by Gordon
03:01
created

ImagePointOfInterestExtensionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpOnce() 0 6 1
A testUpdateCMSFields() 0 12 2
1
<?php
2
3
class ImagePointOfInterestExtensionTest 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
6
	public function setUpOnce() {
7
		$this->requiredExtensions = array(
8
			'ImagePotTestPageTO' => array('MapExtension', 'ImagePointOfInterestExtension')
9
		);
10
		parent::setUpOnce();
11
	}
12
13
	public function testUpdateCMSFields() {
14
		$page = new ImagePotTestPageTO();
15
		$fields = $page->getCMSFields();
16
		$tab = $fields->findOrMakeTab('Root.Main');
17
		$fields = $tab->FieldList();
18
		$names = array();
19
		foreach ($fields as $field) {
20
			$names[] = $field->getName();
21
		}
22
		 
23
		error_log(print_r($names,1));
24
	}
25
26
}
27
28
29
class ImagePotTestPageTO extends Page implements TestOnly {
2 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
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...
30
}
31
32