Completed
Branch AUTOMATED_TESTING (09d9f2)
by Gordon
13:24
created

MapFieldTest::testFieldWithTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 8
rs 9.4286
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
class MapFieldTest extends SapphireTest {
4
5
	public function testFieldWithTitle() {
6
		//$headingLevel = 2, $allowHTML = false, $form = nul
0 ignored issues
show
Unused Code Comprehensibility introduced by
37% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
7
		$field = new MapField('NameOfField','TitleOfField');
8
		$expected = '<div class="editableMap"><div class="middleColumn" id="Nam'
9
				  . 'eOfField" style="width:100%;height:300px;margin:5px 0px 5p'
10
				  . 'x 5px;position:relative;"></div></div>';
11
		$this->assertEquals($expected, $field->Field());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<MapFieldTest>.

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...
12
	}
13
14
	public function testFieldWithoutTitle() {
15
		//$headingLevel = 2, $allowHTML = false, $form = nul
0 ignored issues
show
Unused Code Comprehensibility introduced by
37% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
16
		$field = new MapField('NameOfField');
17
		$expected = '<div class="editableMap"><div class="middleColumn" id="Nam'
18
				  . 'eOfField" style="width:100%;height:300px;margin:5px 0px 5p'
19
				  . 'x 5px;position:relative;"></div></div>';
20
		$this->assertEquals($expected, $field->Field());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<MapFieldTest>.

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...
21
	}
22
23
}
24