SendMessageTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testMissingMandatoryExportField() 0 4 1
A tearDown() 0 4 1
A setUp() 0 4 1
1
<?php
2
3
namespace leocata\M1\tests\Methods\Request;
4
5
use leocata\M1\Methods\Request\SendMessage;
6
use leocata\M1\Tests\Mock\MockApi;
7
use PHPUnit\Framework\TestCase;
8
9
class SendMessageTest extends TestCase
10
{
11
    /**
12
     * @var MockApi
13
     */
14
    private $apiConn;
15
16
    /**
17
     * Prepares the environment before running a test.
18
     */
19
    protected function setUp()
20
    {
21
        parent::setUp();
22
        $this->apiConn = new MockApi();
23
    }
24
25
    /**
26
     * Cleans up the environment after running a test.
27
     */
28
    protected function tearDown()
29
    {
30
        $this->apiConn = null;
31
        parent::tearDown();
32
    }
33
34
    /**
35
     * @expectedException \leocata\M1\Exceptions\MissingMandatoryField
36
     * @expectedExceptionMessage sessionid
37
     */
38
    public function testMissingMandatoryExportField()
39
    {
40
        $sendMessage = new SendMessage();
41
        $sendMessage->export();
42
    }
43
}
44