Passed
Push — master ( 1a6375...8f4058 )
by Petr
08:21 queued 05:12
created

ResultTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 12
c 0
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fullProvider() 0 11 1
A testFull() 0 4 1
1
<?php
2
3
namespace tests\ChecksTests\TraitsTests;
4
5
6
use tests\CommonTestClass;
7
8
9
class ResultTest extends CommonTestClass
10
{
11
    /**
12
     * @param mixed $data
13
     * @param string $mime
14
     * @dataProvider fullProvider
15
     */
16
    public function testFull($data, string $mime): void
17
    {
18
        $lib = new XResult();
19
        $this->assertEquals($mime, $lib->determineResult($data));
20
    }
21
22
    public function fullProvider(): array
23
    {
24
        return [
25
            ['text/plain', 'text/plain'],
26
            ['123456', '123456'],
27
            [123456, 'application/octet-stream'],
28
            [123.456, 'application/octet-stream'],
29
            [true, 'application/octet-stream'],
30
            [false, 'application/octet-stream'],
31
            [null, 'application/octet-stream'],
32
            [new \stdClass(), 'application/octet-stream'],
33
        ];
34
    }
35
}
36