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

testMarkerLabelModel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 60
rs 10
1
<?php
2
3
namespace Clubdeuce\WPLib\Components\GoogleMaps\Tests\Unit;
4
5
use Clubdeuce\WPLib\Components\GoogleMaps\Marker_Label_Model;
6
use Clubdeuce\WPLib\Components\GoogleMaps\Tests\TestCase;
7
8
/**
9
 * Class TestMarkerLabelModel
10
 * @package            Clubdeuce\WPLib\Components\GoogleMaps\Tests\Unit
11
 * @coversDefaultClass Clubdeuce\WPLib\Components\GoogleMaps\Marker_Label_Model
12
 * @group              Map
13
 */
14
class TestMarkerLabelModel extends TestCase {
15
16
	/**
17
	 * @var Marker_Label_Model
18
	 */
19
	private $_model;
20
21
	public function setUp() {
22
		$this->_model = new Marker_Label_Model(array(
23
			'label' => $this->_mockLabel(),
24
		));
25
		parent::setUp();
26
	}
27
28
	/**
29
	 * @covers ::has_label
30
	 */
31
	public function testHasLabel() {
32
		$this->assertTrue($this->_model->has_label());
33
	}
34
35
	/**
36
	 *
37
	 */
38
	public function testMagicCall() {
39
		$this->assertEquals('bar', $this->_model->foo());
40
	}
41
42
	/**
43
	 * @param array $args
44
	 *
45
	 * @return \Mockery\MockInterface
46
	 */
47
	private function _mockLabel($args = array()) {
48
		$mock = \Mockery::mock();
49
50
		$args = wp_parse_args($args, array(
51
			'foo' => 'bar',
52
		));
53
54
		foreach ($args as $key => $val) {
55
			$mock->shouldReceive($key)->andReturn($val);
56
		}
57
58
		return $mock;
59
	}
60
}
61