|
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' => new \stdClass() |
|
30
|
|
|
)), |
|
31
|
|
|
)); |
|
32
|
|
|
parent::setUp(); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @covers ::__construct |
|
37
|
|
|
* @covers ::has_marker |
|
38
|
|
|
*/ |
|
39
|
|
|
public function testHasMarker() { |
|
40
|
|
|
$this->assertTrue($this->_model->has_marker()); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @covers ::__call |
|
45
|
|
|
*/ |
|
46
|
|
|
public function testMagicCall() { |
|
47
|
|
|
$this->assertEquals('bar', $this->_model->foo()); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @covers ::label |
|
52
|
|
|
*/ |
|
53
|
|
|
public function testLabel() { |
|
54
|
|
|
$this->assertInstanceOf(Marker_Label::class, $this->_model->label()); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @covers ::location |
|
59
|
|
|
*/ |
|
60
|
|
|
public function testLocation() { |
|
61
|
|
|
$this->assertInstanceOf(Location::class, $this->_model->location()); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @covers ::info_window |
|
66
|
|
|
*/ |
|
67
|
|
|
public function testInfoWindow() { |
|
68
|
|
|
$this->assertInstanceOf(Info_Window::class, $this->_model->info_window()); |
|
69
|
|
|
} |
|
70
|
|
|
} |