Passed
Branch master (41ef34)
by Roberto
04:08
created

LatLngTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 19
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLatLngSetterGetter() 0 14 1
1
<?php
2
/**
3
 * Copyright (c) 2018 - present
4
 * Google Maps PHP - LatLngTest.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 5/9/2018
8
 * MIT license: https://github.com/biscolab/google-maps-php/blob/master/LICENSE
9
 */
10
11
namespace Biscolab\geocode\Tests;
12
13
use Biscolab\GoogleMaps\Fields\LatLngFields;
14
use Biscolab\GoogleMaps\Object\LatLng;
15
use PHPUnit\Framework\TestCase;
16
17
/**
18
 * Class LatLngTest
19
 * @package Biscolab\geocode\Tests
20
 */
21
class LatLngTest extends TestCase {
22
23
	/**
24
	 * @test
25
	 */
26
	public function testLatLngSetterGetter() {
27
28
		$lat_lng = new LatLng();
29
30
		$lat_lng->setLat(-50.09);
31
		$lat_lng->setLng(-100);
32
33
		$this->assertEquals(new LatLng([
34
			LatLngFields::LAT => -50.09,
35
			LatLngFields::LNG => -100,
36
		]), $lat_lng);
37
38
		$this->assertEquals(-50.09, $lat_lng->getLat());
39
		$this->assertEquals(-100, $lat_lng->getLng());
40
41
	}
42
}
43