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

TestMarkerModel   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 8
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 84
rs 10
1
<?php
2
3
namespace Clubdeuce\WPLib\Components\GoogleMaps\Tests\Unit;
4
5
use Clubdeuce\WPLib\Components\GoogleMaps\Info_Window;
6
use Clubdeuce\WPLib\Components\GoogleMaps\Location;
7
use Clubdeuce\WPLib\Components\GoogleMaps\Marker_Label;
8
use Clubdeuce\WPLib\Components\GoogleMaps\Marker_Model;
9
use Clubdeuce\WPLib\Components\GoogleMaps\Tests\TestCase;
10
11
/**
12
 * Class TestMarkerModel
13
 * @package            Clubdeuce\WPLib\Components\GoogleMaps\Tests\Unit
14
 * @coversDefaultClass Clubdeuce\WPLib\Components\GoogleMaps\Marker_Model
15
 * @group              Map
16
 */
17
class TestMarkerModel extends TestCase {
18
19
	/**
20
	 * @var Marker_Model
21
	 */
22
	private $_model;
23
24
	public function setUp() {
25
		$this->_model = new Marker_Model(array(
26
			'marker' => $this->_mock(array(
27
				'label'       => new \stdClass(),
28
				'location'    => new \stdClass(),
29
				'info_window' => self::_mock(array(
30
					'set_position' => null,
31
				)),
32
				'latitude'    => 100,
33
				'longitude'   => -100,
34
			)),
35
		));
36
		parent::setUp();
37
	}
38
39
	/**
40
	 * @covers ::__construct
41
	 * @covers ::has_marker
42
	 */
43
	public function testHasMarker() {
44
		$this->assertTrue($this->_model->has_marker());
45
	}
46
47
	/**
48
	 * @covers ::__call
49
	 */
50
	public function testMagicCall() {
51
		$this->assertEquals('bar', $this->_model->foo());
52
	}
53
54
	/**
55
	 * @covers ::label
56
	 */
57
	public function testLabel() {
58
		$this->assertInstanceOf(Marker_Label::class, $this->_model->label());
59
	}
60
61
	/**
62
	 * @covers ::location
63
	 */
64
	public function testLocation() {
65
		$this->assertInstanceOf(Location::class, $this->_model->location());
66
	}
67
68
	/**
69
	 * @covers ::info_window
70
	 */
71
	public function testInfoWindow() {
72
		$this->assertInstanceOf(Info_Window::class, $this->_model->info_window());
73
	}
74
}