OpenStreetTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetMapUrl() 0 19 1
1
<?php
2
/**
3
 * Codru Components
4
 *
5
 * @author Maxim Vasiliev <[email protected]>
6
 * @license http://www.opensource.org/licenses/bsd-license.php
7
 */
8
9
class OpenStreetTest extends \yii\codeception\TestCase
0 ignored issues
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...
10
{
11
    public $appConfig = '@tests/unit/_config.php';
12
13
    public function testGetMapUrl()
14
    {
15
        $map = [
16
            'class' => \codru\staticmap\types\OpenStreet::className(),
17
            'options' => [
18
                'center' => '40,50',
19
                'zoom' => '15',
20
                'size' => '1024x200',
21
                'markers' => [
22
                    '40,50',
23
                    'ol-marker',
24
                ],
25
            ],
26
        ];
27
        $this->assertEquals(
28
            'http://staticmap.openstreetmap.de/staticmap.php?center=40,50&zoom=15&size=1024x200&markers=40,50,ol-marke',
29
            Yii::createObject($map)->getMapUrl()
30
        );
31
    }
32
}
33