Completed
Push — master ( ec5411...629401 )
by Kamil
31:49 queued 16:57
created

AvatarImageSpec::its_file_is_mutable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace spec\Sylius\Component\Core\Model;
15
16
use PhpSpec\ObjectBehavior;
17
use Sylius\Component\Core\Model\Image;
18
19
final class AvatarImageSpec extends ObjectBehavior
20
{
21
    function it_extends_an_image(): void
22
    {
23
        $this->shouldHaveType(Image::class);
24
    }
25
26
    function it_does_not_have_id_by_default(): void
27
    {
28
        $this->getId()->shouldReturn(null);
29
    }
30
31
    function it_does_not_have_file_by_default(): void
32
    {
33
        $this->hasFile()->shouldReturn(false);
34
        $this->getFile()->shouldReturn(null);
35
    }
36
37
    function its_file_is_mutable(): void
38
    {
39
        $file = new \SplFileInfo(__FILE__);
40
        $this->setFile($file);
41
        $this->getFile()->shouldReturn($file);
42
    }
43
44
    function its_path_is_mutable(): void
45
    {
46
        $this->setPath(__FILE__);
47
        $this->getPath()->shouldReturn(__FILE__);
48
    }
49
50
    function it_does_not_have_type_by_default(): void
51
    {
52
        $this->getType()->shouldReturn(null);
53
    }
54
55
    function its_type_is_mutable(): void
56
    {
57
        $this->setType('banner');
58
        $this->getType()->shouldReturn('banner');
59
    }
60
61
    function it_does_not_have_owner_by_default(): void
62
    {
63
        $this->getOwner()->shouldReturn(null);
64
    }
65
66
    function its_owner_is_mutable(): void
67
    {
68
        $owner = new \stdClass();
69
70
        $this->setOwner($owner);
71
        $this->getOwner()->shouldReturn($owner);
72
    }
73
}
74