CommonTestClass   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
dl 0
loc 37
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A mockUser() 0 5 1
A mockAttachment() 0 8 1
A mockContent() 0 6 1
A mockResult() 0 3 1
1
<?php
2
3
use kalanis\EmailApi\Basics;
4
use PHPUnit\Framework\TestCase;
5
6
7
class CommonTestClass extends TestCase
8
{
9
//    public function providerBasic()
10
//    {
11
//    }
12
13
    protected function mockContent(): Basics\Content
14
    {
15
        return (new Basics\Content())->setData(
16
            'testing content',
17
            'qwertzuiopasdfghjklyxcvbnm',
18
            'on_testing_service'
19
        );
20
    }
21
22
    protected function mockAttachment(): Basics\Attachment
23
    {
24
        return (new Basics\Attachment())->setData(
25
            'testing_file',
26
            '',
27
            'qwertzuiopasdfghjklyxcvbnm',
28
            'text/plain',
29
            'utf8'
30
        );
31
    }
32
33
    protected function mockUser(): Basics\User
34
    {
35
        return (new Basics\User())->setData(
36
            '[email protected]',
37
            'Bob'
38
        );
39
    }
40
41
    protected function mockResult(bool $status): Basics\Result
42
    {
43
        return new Basics\Result($status, 'Testing response');
44
    }
45
}
46