RestTest::testExcept()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
use kalanis\EmailApi\Exceptions;
4
use kalanis\EmailApi\LocalInfo;
5
use kalanis\EmailApi\Services;
6
7
8
class RestTest extends CommonTestClass
9
{
10
    public function testExcept()
11
    {
12
        $ex = new Exceptions\EmailException('something');
13
        $this->assertEquals('something', $ex->getMessage());
14
    }
15
16
    public function testInternal()
17
    {
18
        $lib = new Services\Internal();
19
        $this->assertTrue($lib->canUseService());
20
        $this->assertEquals(1, $lib->systemServiceId());
21
        // more is not possible - here is direct system call for email
22
    }
23
24
    public function testInternalDies()
25
    {
26
        $data = $this->mockContent();
27
        $data->addAttachment($this->mockAttachment());
28
        $lib = new Services\Internal();
29
        $result = $lib->sendEmail($data, $this->mockUser());
30
        $this->assertFalse($result->getStatus());
31
    }
32
33
    public function testLocalProcessing()
34
    {
35
        $lib = new LocalInfo\LocalProcessing(); // necessary in subservices
36
        $lib->enableMailLocally($this->mockUser());
37
        $this->assertTrue(true); // because coverage sniffing
38
    }
39
}
40