1 | <?php |
||
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 | } |