1 | <?php |
||
10 | class ArticleMediaSpec extends ObjectBehavior |
||
11 | { |
||
12 | function it_is_initializable() |
||
13 | { |
||
14 | $this->shouldHaveType(ArticleMedia::class); |
||
15 | } |
||
16 | |||
17 | function let() |
||
18 | { |
||
19 | $media = [ |
||
20 | 'id' => '5', |
||
21 | 'filename' => 'apple-box', |
||
22 | 'originalFilename' => 'Apple Box', |
||
23 | 'originalFilenameSlugged' => 'App..Box.jpeg', |
||
24 | 'description' => 'The biggest image', |
||
25 | 'title' => 'Apple Box Title', |
||
26 | 'visible' => 1, |
||
27 | 'created_at' => '2011-05-19 20:46:21.000000', |
||
28 | 'updated_at' => '2016-01-11 00:00:00.000000', |
||
29 | 'mime' => 'image/jpeg', |
||
30 | 'type' => 'image', |
||
31 | 'size' => 11345, |
||
32 | 'extension' => 'jpg', |
||
33 | 'category_ids' => [1, 2, 3], |
||
34 | 'link_url' => 'http://site.com/media/original/apple-box.jpg', |
||
35 | ]; |
||
36 | |||
37 | $data = [ |
||
38 | 'id' => '10', |
||
39 | 'display_order' => '5', |
||
40 | 'media' => $media, |
||
41 | ]; |
||
42 | |||
43 | $this->beConstructedWith($data); |
||
44 | } |
||
45 | |||
46 | function it_should_be_hydrated() |
||
47 | { |
||
48 | $this->getId()->shouldReturn(10); |
||
49 | $this->getDisplayOrder()->shouldReturn(5); |
||
50 | $this->getMedia()->shouldBeAnInstanceOf(Media::class); |
||
51 | } |
||
52 | } |
||
53 |