Completed
Push — taxon-ancestor ( 0755ef )
by Kamil
119:50 queued 87:37
created

ReviewSpec::it_is_initializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
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\Review\Model;
15
16
use PhpSpec\ObjectBehavior;
17
use Sylius\Component\Review\Model\ReviewableInterface;
18
use Sylius\Component\Review\Model\ReviewerInterface;
19
use Sylius\Component\Review\Model\ReviewInterface;
20
21
/**
22
 * @author Mateusz Zalewski <[email protected]>
23
 */
24
final class ReviewSpec extends ObjectBehavior
25
{
26
    function it_implements_review_interface(): void
27
    {
28
        $this->shouldImplement(ReviewInterface::class);
29
    }
30
31
    function it_has_a_title(): void
32
    {
33
        $this->setTitle('review title');
34
        $this->getTitle()->shouldReturn('review title');
35
    }
36
37
    function it_has_a_rating(): void
38
    {
39
        $this->setRating(5);
40
        $this->getRating()->shouldReturn(5);
41
    }
42
43
    function it_has_a_comment(): void
44
    {
45
        $this->setComment('Lorem ipsum dolor');
46
        $this->getComment()->shouldReturn('Lorem ipsum dolor');
47
    }
48
49
    function it_has_an_author(ReviewerInterface $author): void
50
    {
51
        $this->setAuthor($author);
52
        $this->getAuthor()->shouldReturn($author);
53
    }
54
55
    function it_has_a_status(): void
56
    {
57
        $this->getStatus()->shouldReturn(ReviewInterface::STATUS_NEW);
58
    }
59
60
    function it_has_a_review_subject(ReviewableInterface $reviewSubject): void
61
    {
62
        $this->setReviewSubject($reviewSubject);
63
        $this->getReviewSubject()->shouldReturn($reviewSubject);
64
    }
65
66
    function it_has_a_created_at(\DateTime $createdAt): void
67
    {
68
        $this->setCreatedAt($createdAt);
69
        $this->getCreatedAt()->shouldReturn($createdAt);
70
    }
71
72
    function it_has_an_updated_at(\DateTime $updatedAt): void
73
    {
74
        $this->setUpdatedAt($updatedAt);
75
        $this->getUpdatedAt()->shouldReturn($updatedAt);
76
    }
77
}
78