Conditions | 2 |
Paths | 2 |
Total Lines | 38 |
Code Lines | 29 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
21 | public function testShowGuideMarkers() { |
||
22 | $layer = $this->objFromFixture('PointsOfInterestLayer', 'BTS'); |
||
23 | error_log('LAYER: '.$layer->Name); |
||
24 | $pois = $layer->PointsOfInterest(); |
||
25 | $poi = $pois->first(); |
||
26 | |||
27 | // guidemarkers off, expect null returned |
||
28 | $layer->ShowGuideMarkers = 0; |
||
29 | $layer->write(); |
||
30 | $fields = $poi->getCMSFields(); |
||
31 | $guidepoints = $poi->getMapField()->getGuidePoints(); |
||
32 | $this->assertNull($guidepoints); |
||
1 ignored issue
–
show
|
|||
33 | |||
34 | // guidemarkers on, convert datalist to an array of coordinates |
||
35 | $layer->ShowGuideMarkers = 1; |
||
36 | $layer->write(); |
||
37 | $fields = $poi->getCMSFields(); |
||
38 | $guidepoints = $poi->getMapField()->getGuidePoints(); |
||
39 | $expected = array(); |
||
1 ignored issue
–
show
|
|||
40 | $coors = array(); |
||
41 | foreach ($guidepoints as $gp) { |
||
42 | $coors[] = array($gp->Lat, $gp->Lon); |
||
43 | } |
||
44 | |||
45 | $expected = array( |
||
46 | array(13.77965803301,100.54461523531), |
||
47 | array(13.744081610619, 100.54311513861), |
||
48 | array(13.802594511242, 100.55379467004), |
||
49 | array(13.74054138487, 100.55545772112), |
||
50 | array(13.756924089277, 100.53381164654), |
||
51 | array(13.751846080459, 100.53157277536), |
||
52 | array(13.772614550915, 100.54209276599), |
||
53 | array(13.793846082833, 100.54974883766), |
||
54 | array(13.762764662241, 100.53706848861) |
||
55 | ); |
||
56 | $this->assertEquals($expected, $coors); |
||
1 ignored issue
–
show
|
|||
57 | |||
58 | } |
||
59 | |||
61 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.