Completed
Push — master ( 8865c9...169b65 )
by Christian
03:22
created

AttachmentNormalizerSpec::it_is_a_normalizer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace spec\Xabbuh\XApi\Serializer\Normalizer;
4
5
use PhpSpec\ObjectBehavior;
6
use Xabbuh\XApi\Model\Attachment;
7
use Xabbuh\XApi\Model\IRI;
8
use Xabbuh\XApi\Model\LanguageMap;
9
10
class AttachmentNormalizerSpec extends ObjectBehavior
11
{
12
    function it_is_a_normalizer()
13
    {
14
        $this->shouldHaveType('Symfony\Component\Serializer\Normalizer\NormalizerInterface');
15
    }
16
17
    function it_supports_normalizing_attachment_objects()
18
    {
19
        $attachment = new Attachment(
20
            IRI::fromString('http://id.tincanapi.com/attachment/supporting_media'),
21
            'text/plain',
22
            18,
23
            'bd1a58265d96a3d1981710dab8b1e1ed04a8d7557ea53ab0cf7b44c04fd01545',
24
            LanguageMap::create(array('en-US' => 'Text attachment'))
25
        );
26
27
        $this->supportsNormalization($attachment)->shouldReturn(true);
28
    }
29
30
    function it_is_a_denormalizer()
31
    {
32
        $this->shouldHaveType('Symfony\Component\Serializer\Normalizer\DenormalizerInterface');
33
    }
34
35
    function it_supports_denormalizing_to_attachment_objects()
36
    {
37
        $this->supportsDenormalization(array(), 'Xabbuh\XApi\Model\Attachment')->shouldReturn(true);
38
    }
39
}
40