1 | <?php |
||
12 | class GcmComponentTest extends TestCase |
||
13 | { |
||
14 | public $component = null; |
||
15 | |||
16 | public $controller = null; |
||
17 | |||
18 | public $ids = []; |
||
19 | |||
20 | |||
21 | public function setUp() |
||
22 | { |
||
23 | parent::setUp(); |
||
24 | // Setup our component and fake test controller |
||
25 | $request = new Request(); |
||
26 | $response = new Response(); |
||
27 | $this->controller = $this->getMock( |
||
28 | 'Cake\Controller\Controller', |
||
29 | null, |
||
30 | [$request, $response] |
||
31 | ); |
||
32 | $registry = new ComponentRegistry($this->controller); |
||
33 | $this->component = new GcmComponent($registry); |
||
34 | } |
||
35 | |||
36 | public function testSendError() |
||
37 | { |
||
38 | $isSend = $this->component->send($this->ids); |
||
39 | $this->assertEquals(new Exception(), $isSend); |
||
40 | } |
||
41 | |||
42 | public function tearDown() |
||
43 | { |
||
44 | parent::tearDown(); |
||
45 | // Clean up after we're done |
||
46 | unset($this->component, $this->controller); |
||
47 | } |
||
48 | } |
||
49 |