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

ImagePointOfInterestExtensionTest::setUpOnce()   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 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