Completed
Pull Request — master (#22)
by Daryl
01:32
created

testGoogleMaps   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 115
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 10
c 2
b 0
f 1
lcom 1
cbo 2
dl 0
loc 115
rs 10
1
<?php
2
3
namespace Clubdeuce\WPLib\Components\GoogleMaps\Tests\Unit;
4
5
use Clubdeuce\WPGoogleMaps\Google_Maps as GM;
6
use Clubdeuce\WPLib\Components\Google_Maps;
7
use Clubdeuce\WPLib\Components\GoogleMaps\Map;
8
use Clubdeuce\WPLib\Components\GoogleMaps\Marker;
9
use Clubdeuce\WPLib\Components\GoogleMaps\Tests\TestCase;
10
11
/**
12
 * Class testGoogleMaps
13
 * @package            Clubdeuce\WPLib\Components\GoogleMaps\Tests\Unit
14
 * @coversDefaultClass \Clubdeuce\WPLib\Components\Google_Maps
15
 */
16
class testGoogleMaps extends TestCase {
17
18
	/**
19
	 * @covers ::on_load
20
	 */
21
	public function testAutoloadWorks() {
22
23
		Google_Maps::on_load();
24
		$this->assertTrue(class_exists(GM::class));
25
26
	}
27
28
	/**
29
	 * @covers ::make_new_map
30
	 */
31
	public function testMakeNewMapReturnsMyMap() {
32
33
		$map = Google_Maps::make_new_map(array(
34
			'center' => array('lat' => 123.45, 'lng' => '-123.45')
35
		));
36
37
		$this->assertInstanceOf(Map::class, $map);
38
39
	}
40
41
	/**
42
	 * @covers ::make_marker_by_address
43
	 */
44
	public function testMakeMarkerByAddress() {
45
46
		$marker = Google_Maps::make_marker_by_address('1600 Pennsylvania Avenue NW Washington DC');
47
48
		$this->assertInstanceOf(Marker::class, $marker);
49
50
	}
51
52
	/**
53
	 * @covers ::make_marker_by_position
54
	 */
55
	public function testMakeMarkerByPosition() {
56
57
		$marker = Google_Maps::make_marker_by_position(123.45, -123.45);
58
59
		$this->assertInstanceOf(Marker::class, $marker);
60
61
	}
62
}