-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathChromeTest.php
135 lines (122 loc) · 4.37 KB
/
ChromeTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
/**
* gomoob/php-pushwoosh
*
* @copyright Copyright (c) 2015, GOMOOB SARL (http://gomoob.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE.md file)
*/
namespace Gomoob\Pushwoosh\Model\Notification;
use PHPUnit\Framework\TestCase;
/**
* Test case used to test the <code>Chrome</code> class.
*
* @author Baptiste GAILLARD ([email protected])
* @group ChromeTest
*/
class ChromeTest extends TestCase
{
/**
* Test method for the <code>#create()</code> function;
*/
public function testCreate()
{
$this->assertNotNull(Chrome::create());
}
/**
* Test method for the <code>#getGcmTtl()</code> and <code>setGcmTtl($gctTtl)</code> functions.
*/
public function testGetSetGcmTtl()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setGcmTtl(3600));
$this->assertSame(3600, $chrome->getGcmTtl());
}
/**
* Test method for the <code>#getIcon()</code> and <code>#setIcon($icon)</code> functions.
*/
public function testGetSetIcon()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setIcon('icon'));
$this->assertSame('icon', $chrome->getIcon());
}
/**
* Test method for the <code>#getTitle()</code> and <code>#setTitle($title)</code> functions.
*/
public function testGetSetTitle()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setTitle('Title'));
$this->assertSame('Title', $chrome->getTitle());
}
/**
* Test method for the <code>#getImage()</code> and <code>#setImage($image)</code> functions.
*/
public function testGetSetImage()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setImage('Image'));
$this->assertSame('Image', $chrome->getImage());
}
/**
* Test method for the <code>#getButtonTextOne()</code> and <code>#setButtonTextOne($text)</code> functions.
*/
public function testGetButtonTextOne()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setButtonTextOne('ButtonTextOne'));
$this->assertSame('ButtonTextOne', $chrome->getButtonTextOne());
}
/**
* Test method for the <code>#getButtonUrlOne()</code> and <code>#setButtonUrlOne($url)</code> functions.
*/
public function testGetButtonUrlOne()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setButtonUrlOne('ButtonUrlOne'));
$this->assertSame('ButtonUrlOne', $chrome->getButtonUrlOne());
}
/**
* Test method for the <code>#getButtonTextTwo()</code> and <code>#setButtonTextTwo($text)</code> functions.
*/
public function testGetButtonTextTwo()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setButtonTextTwo('ButtonTextTwo'));
$this->assertSame('ButtonTextTwo', $chrome->getButtonTextTwo());
}
/**
* Test method for the <code>#getButtonUrlTwo()</code> and <code>#setButtonUrlTwo($url)</code> functions.
*/
public function testGetButtonUrlTwo()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setButtonUrlTwo('ButtonUrlTwo'));
$this->assertSame('ButtonUrlTwo', $chrome->getButtonUrlTwo());
}
/**
* Test method for the <code>#jsonSerialize()</code> function.
*/
public function testJsonSerialize()
{
$array = Chrome::create()
->setGcmTtl(3600)
->setIcon('icon')
->setTitle('Title')
->setImage('Image')
->setButtonTextOne('ButtonTextOne')
->setButtonUrlOne('ButtonUrlOne')
->setButtonTextTwo('ButtonTextTwo')
->setButtonUrlTwo('ButtonUrlTwo')
->jsonSerialize();
$this->assertCount(8, $array);
$this->assertSame(3600, $array['chrome_gcm_ttl']);
$this->assertSame('icon', $array['chrome_icon']);
$this->assertSame('Title', $array['chrome_title']);
$this->assertSame('Image', $array['chrome_image']);
$this->assertSame('ButtonTextOne', $array['chrome_button_text1']);
$this->assertSame('ButtonUrlOne', $array['chrome_button_url1']);
$this->assertSame('ButtonTextTwo', $array['chrome_button_text2']);
$this->assertSame('ButtonUrlTwo', $array['chrome_button_url2']);
}
}