Completed
Push — master ( 048bf8...346c21 )
by Leo
03:28
created

SendMessageTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 32
rs 10
c 0
b 0
f 0

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\HttpClientAuthorization;
6
use leocata\M1\Methods\Request\SendMessage;
7
use leocata\M1\Tests\Mock\MockApi;
8
use PHPUnit\Framework\TestCase;
9
10
class SendMessageTest extends TestCase
11
{
12
    /**
13
     * @var MockApi
14
     */
15
    private $apiConn;
16
17
    /**
18
     * Prepares the environment before running a test.
19
     */
20
    protected function setUp()
21
    {
22
        parent::setUp();
23
        $this->apiConn = new MockApi(new HttpClientAuthorization('', ''));
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
     * @expectedException \leocata\M1\Exceptions\MissingMandatoryField
35
     * @expectedExceptionMessage sessionid
36
     */
37
38
    public function testMissingMandatoryExportField()
39
    {
40
        $sendMessage = new SendMessage();
41
        $sendMessage->export();
42
    }
43
}
44