Passed
Push — master ( 2ddebf...84c74c )
by Petr
09:17 queued 01:35
created

ResultTest::testFull()   A

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
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace CheckTests\TraitsTests;
4
5
6
use CommonTestClass;
7
use kalanis\kw_mime\Check\Traits\TResult;
8
9
10
class ResultTest extends CommonTestClass
11
{
12
    /**
13
     * @param mixed $data
14
     * @param string $mime
15
     * @dataProvider fullProvider
16
     */
17
    public function testFull($data, string $mime): void
18
    {
19
        $lib = new XResult();
20
        $this->assertEquals($mime, $lib->determineResult($data));
21
    }
22
23
    public function fullProvider(): array
24
    {
25
        return [
26
            ['text/plain', 'text/plain'],
27
            ['123456', '123456'],
28
            [123456, 'application/octet-stream'],
29
            [123.456, 'application/octet-stream'],
30
            [true, 'application/octet-stream'],
31
            [false, 'application/octet-stream'],
32
            [null, 'application/octet-stream'],
33
            [new \stdClass(), 'application/octet-stream'],
34
        ];
35
    }
36
}
37
38
39
class XResult
40
{
41
    use TResult;
42
}
43