Test Failed
Push — master ( 85e235...5ad4a7 )
by Vítězslav
02:46
created

FormatsTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Test\FlexiPeeHP;
4
5
/**
6
 * Generated by PHPUnit_SkeletonGenerator on 2017-06-25 at 23:33:48.
7
 */
8
class FormatsTest extends \PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @var Formats
12
     */
13
    protected $object;
14
15
    /**
16
     * Sets up the fixture, for example, opens a network connection.
17
     * This method is called before a test is executed.
18
     */
19
    protected function setUp()
20
    {
21
        $this->object = new \FlexiPeeHP\Formats();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \FlexiPeeHP\Formats() of type object<FlexiPeeHP\Formats> is incompatible with the declared type object<Test\FlexiPeeHP\Formats> of property $object.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
22
    }
23
24
    /**
25
     * Tears down the fixture, for example, closes a network connection.
26
     * This method is called after a test is executed.
27
     */
28
    protected function tearDown()
29
    {
30
31
    }
32
33
    /**
34
     * @covers FlexiPeeHP\Formats::byContentType
35
     */
36
    public function testByContentType()
37
    {
38
        $contentTypes = \FlexiPeeHP\Formats::byContentType();
39
        $this->assertEquals('application/javascript', key($contentTypes));
40
    }
41
42
    /**
43
     * @covers FlexiPeeHP\Formats::bySuffix
44
     */
45
    public function testBySuffix()
46
    {
47
        $suffixes = \FlexiPeeHP\Formats::bySuffix();
48
        $this->assertEquals('js', key($suffixes));
49
    }
50
51
    /**
52
     * @covers FlexiPeeHP\Formats::suffixToContentType
53
     */
54
    public function testSuffixToContentType()
55
    {
56
        $this->assertEquals('application/pdf',
57
            \FlexiPeeHP\Formats::suffixToContentType('pdf'));
58
    }
59
60
    /**
61
     * @covers FlexiPeeHP\Formats::contentTypeToSuffix
62
     */
63
    public function testContentTypeToSuffix()
64
    {
65
        $this->assertEquals('text/csv',
66
            \FlexiPeeHP\Formats::suffixToContentType('csv'));
67
    }
68
}
69