1 | <?php |
||
16 | |||
17 | /** |
||
18 | * @var Marker |
||
19 | */ |
||
20 | private $_marker; |
||
21 | |||
22 | public function setUp() { |
||
23 | $this->_marker = new Marker(array( |
||
24 | 'address' => '1600 Amphitheatre Parkway, Mountain View, CA 94043, USA', |
||
25 | 'title' => 'Sample Location' |
||
26 | )); |
||
27 | |||
28 | parent::setUp(); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @covers ::location |
||
33 | */ |
||
34 | public function testLocation() { |
||
35 | $marker = $this->_marker; |
||
36 | |||
37 | $this->assertInstanceOf('\Clubdeuce\WPLib\Components\GoogleMaps\Location', $marker->location()); |
||
38 | $this->assertInstanceOf('\Clubdeuce\WPLib\Components\GoogleMaps\Marker_Label', $marker->label()); |
||
39 | $this->assertInternalType('double', $marker->latitude()); |
||
40 | $this->assertInternalType('double', $marker->longitude()); |
||
41 | $this->assertInternalType('string', $marker->title()); |
||
42 | $this->assertInstanceOf('\Clubdeuce\WPLib\Components\GoogleMaps\Info_Window', $marker->info_window()); |
||
43 | $this->assertInternalType('array', $marker->marker_args()); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @coversNothing |
||
48 | */ |
||
49 | public function testInfoWindow() { |
||
50 | $window = $this->_marker->info_window(); |
||
51 | |||
52 | $this->assertInternalType('string', $window->content()); |
||
53 | $this->assertInternalType('integer', $window->pixel_offset()); |
||
54 | $this->assertInternalType('array', $window->position()); |
||
55 | $this->assertNull($window->max_width()); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @coversNothing |
||
60 | */ |
||
61 | public function testMarkerLabel() { |
||
62 | $label = $this->_marker->label(); |
||
63 | |||
64 | $this->assertInternalType('string', $label->color(), 'Color is not a string'); |
||
65 | $this->assertInternalType('string', $label->font_family(), 'font_family is not a string'); |
||
66 | $this->assertInternalType('string', $label->font_size(), 'font_size is not a string'); |
||
67 | $this->assertInternalType('string', $label->font_weight()); |
||
68 | $this->assertInternalType('string', $label->text()); |
||
69 | } |
||
70 | |||
71 | } |
||
72 |