DeletingSubAccountEventTest::test__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the smsmode-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\SmsModeBundle\Tests\Event;
13
14
use WBW\Bundle\SmsModeBundle\Event\DeletingSubAccountEvent;
15
use WBW\Bundle\SmsModeBundle\Tests\AbstractTestCase;
16
use WBW\Library\SmsMode\Request\DeletingSubAccountRequest;
17
use WBW\Library\SmsMode\Response\DeletingSubAccountResponse;
18
19
/**
20
 * Deleting sub-account event test.
21
 *
22
 * @author webeweb <https://github.com/webeweb>
23
 * @package WBW\Bundle\SmsModeBundle\Tests\Event
24
 */
25
class DeletingSubAccountEventTest extends AbstractTestCase {
26
27
    /**
28
     * Test setRequest()
29
     *
30
     * @return void
31
     */
32
    public function testSetRequest(): void {
33
34
        // Set a Deleting sub-account request mock.
35
        $request = new DeletingSubAccountRequest();
36
37
        $obj = new DeletingSubAccountEvent($this->deletingSubAccount);
38
39
        $obj->setRequest($request);
40
        $this->assertSame($request, $obj->getRequest());
41
    }
42
43
    /**
44
     * Test setResponse()
45
     *
46
     * @return void
47
     */
48
    public function testSetResponse(): void {
49
50
        // Set a Deleting sub-account response mock.
51
        $response = new DeletingSubAccountResponse();
52
53
        $obj = new DeletingSubAccountEvent($this->deletingSubAccount);
54
55
        $obj->setResponse($response);
56
        $this->assertSame($response, $obj->getResponse());
57
    }
58
59
    /**
60
     * Test __construct()
61
     *
62
     * @return void
63
     */
64
    public function test__construct(): void {
65
66
        $this->assertEquals("wbw.smsmode.event.deleting_sub_account", DeletingSubAccountEvent::EVENT_NAME);
67
68
        $obj = new DeletingSubAccountEvent($this->deletingSubAccount);
69
70
        $this->assertEquals(DeletingSubAccountEvent::EVENT_NAME, $obj->getEventName());
71
72
        $this->assertNull($obj->getRequest());
73
        $this->assertNull($obj->getResponse());
74
75
        $this->assertSame($this->deletingSubAccount, $obj->getDeletingSubAccount());
76
    }
77
}
78