-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathChromeTest.php
99 lines (89 loc) · 2.88 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
<?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>#getDuration()</code> and <code>#setDuration($image)</code> functions.
*/
public function testGetSetDuration()
{
$chrome = new Chrome();
$this->assertSame($chrome, $chrome->setDuration(120));
$this->assertSame(120, $chrome->getDuration());
}
/**
* Test method for the <code>#jsonSerialize()</code> function.
*/
public function testJsonSerialize()
{
$array = Chrome::create()
->setGcmTtl(3600)
->setIcon('icon')
->setTitle('Title')
->setImage('Image')
->setDuration(120)
->jsonSerialize();
$this->assertCount(5, $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(120, $array['chrome_duration']);
}
}