Completed
Push — master ( 0a7932...aee286 )
by Maksim
13s
created

BinaryTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2
Metric Value
dl 0
loc 30
wmc 4
lcom 1
cbo 2
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testImplementsBinaryInterface() 0 6 1
A testAllowGetContentSetInConstructor() 0 6 1
A testAllowGetMimeTypeSetInConstructor() 0 6 1
A testAllowGetFormatSetInConstructor() 0 6 1
1
<?php
2
3
namespace Liip\ImagineBundle\Tests\Model;
4
5
use Liip\ImagineBundle\Model\Binary;
6
7
/**
8
 * @covers Liip\ImagineBundle\Model\Binary
9
 */
10
class BinaryTest extends \PHPUnit_Framework_TestCase
11
{
12
    public function testImplementsBinaryInterface()
13
    {
14
        $rc = new \ReflectionClass('Liip\ImagineBundle\Model\Binary');
15
16
        $this->assertTrue($rc->implementsInterface('Liip\ImagineBundle\Binary\BinaryInterface'));
17
    }
18
19
    public function testAllowGetContentSetInConstructor()
20
    {
21
        $image = new Binary('theContent', 'image/png', 'png');
22
23
        $this->assertEquals('theContent', $image->getContent());
24
    }
25
26
    public function testAllowGetMimeTypeSetInConstructor()
27
    {
28
        $image = new Binary('aContent', 'image/png', 'png');
29
30
        $this->assertEquals('image/png', $image->getMimeType());
31
    }
32
33
    public function testAllowGetFormatSetInConstructor()
34
    {
35
        $image = new Binary('aContent', 'image/png', 'png');
36
37
        $this->assertEquals('png', $image->getFormat());
38
    }
39
}
40