|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Clubdeuce\WPLib\Components\GoogleMaps\Tests\UnitTests; |
|
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\UnitTests |
|
11
|
|
|
* |
|
12
|
|
|
* @coversDefaultClass Clubdeuce\WPLib\Components\GoogleMaps\Marker_Label_Model |
|
13
|
|
|
* |
|
14
|
|
|
* @group MarkerLabel |
|
15
|
|
|
* @group Marker |
|
16
|
|
|
*/ |
|
17
|
|
|
class testMarkerLabelModel extends TestCase { |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @var Marker_Label_Model |
|
21
|
|
|
*/ |
|
22
|
|
|
private $_model; |
|
23
|
|
|
|
|
24
|
|
|
public function setUp() { |
|
25
|
|
|
|
|
26
|
|
|
$this->_model = new Marker_Label_Model(); |
|
27
|
|
|
parent::setUp(); |
|
28
|
|
|
|
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @covers ::color |
|
33
|
|
|
* @covers ::font_family |
|
34
|
|
|
* @covers ::font_size |
|
35
|
|
|
* @covers ::font_weight |
|
36
|
|
|
* @covers ::text |
|
37
|
|
|
*/ |
|
38
|
|
|
public function testDefaults() { |
|
39
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
$this->assertEquals('black', $this->_model->color()); |
|
42
|
|
|
$this->assertInternalType('string', $this->_model->font_family()); |
|
43
|
|
|
$this->assertEmpty($this->_model->font_family()); |
|
44
|
|
|
$this->assertEquals('14px', $this->_model->font_size()); |
|
45
|
|
|
$this->assertEquals('400', $this->_model->font_weight()); |
|
46
|
|
|
$this->assertInternalType('string', $this->_model->text()); |
|
47
|
|
|
$this->assertEmpty($this->_model->text()); |
|
48
|
|
|
|
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @covers ::color |
|
53
|
|
|
* @covers ::font_family |
|
54
|
|
|
* @covers ::font_size |
|
55
|
|
|
* @covers ::font_weight |
|
56
|
|
|
* @covers ::text |
|
57
|
|
|
*/ |
|
58
|
|
|
public function testPassedArguments() { |
|
59
|
|
|
|
|
60
|
|
|
$model = new Marker_Label_Model(array( |
|
61
|
|
|
'color' => 'blue', |
|
62
|
|
|
'font_family' => 'Arial', |
|
63
|
|
|
'font_size' => '22px', |
|
64
|
|
|
'font_weight' => 900, |
|
65
|
|
|
'text' => 'Lorem ipsum dolor est', |
|
66
|
|
|
)); |
|
67
|
|
|
|
|
68
|
|
|
$this->assertEquals('blue', $model->color()); |
|
69
|
|
|
$this->assertEquals('Arial', $model->font_family()); |
|
70
|
|
|
$this->assertEquals('22px', $model->font_size()); |
|
71
|
|
|
$this->assertEquals('900', $model->font_weight()); |
|
72
|
|
|
$this->assertEquals('Lorem ipsum dolor est', $model->text()); |
|
73
|
|
|
|
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
} |