GoogleTest::testGetMapUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 20
rs 9.4285
cc 1
eloc 14
nc 1
nop 0
1
<?php
2
3
/**
4
 * Codru Components
5
 *
6
 * @author Maxim Vasiliev <[email protected]>
7
 * @license http://www.opensource.org/licenses/bsd-license.php
8
 */
9
class GoogleTest 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\Google::className(),
17
            'options' => [
18
                'center' => '40,50',
19
                'zoom' => '13',
20
                'size' => '640x100',
21
                'scale' => '2',
22
                'markers' => [
23
                    'size' => 'tiny',
24
                    '40,50',
25
                ],
26
            ],
27
        ];
28
        $this->assertEquals(
29
            'http://maps.googleapis.com/maps/api/staticmap?center=40,50&zoom=13&size=640x100&scale=2&markers=size:tiny|40,5',
30
            Yii::createObject($map)->getMapUrl()
31
        );
32
    }
33
}
34