11<?php
22
3- /**
4- * @copyright Copyright (C) Ibexa AS. All rights reserved.
5- * @license For full copyright and license information view LICENSE file distributed with this source code.
6- */
7-
83namespace spec \Ibexa \HttpCache \ResponseTagger \Value ;
94
10- use FOS \HttpCache \ResponseTagger ;
115use Ibexa \Contracts \Core \Repository \Values \Content \ContentInfo ;
6+ use Ibexa \Core \Repository \Values \Content \Location ;
127use Ibexa \HttpCache \ResponseTagger \Value \ContentInfoTagger ;
8+ use FOS \HttpCache \ResponseTagger ;
139use PhpSpec \ObjectBehavior ;
14- use Prophecy \ Argument ;
10+ use RuntimeException ;
1511
1612class ContentInfoTaggerSpec extends ObjectBehavior
1713{
1814 public function let (ResponseTagger $ tagHandler ): void
1915 {
2016 $ this ->beConstructedWith ($ tagHandler );
21-
22- $ tagHandler ->addTags (Argument::any ())->willReturn ($ tagHandler );
2317 }
2418
2519 public function it_is_initializable (): void
@@ -29,18 +23,14 @@ public function it_is_initializable(): void
2923
3024 public function it_ignores_non_content_info (ResponseTagger $ tagHandler ): void
3125 {
32- $ this ->tag (null );
26+ $ this ->tag (new Location () );
3327
34- $ tagHandler ->addTags ()->shouldNotHaveBeenCalled ();
28+ $ tagHandler ->addTags ([] )->shouldNotHaveBeenCalled ();
3529 }
3630
3731 public function it_tags_with_content_and_content_type_id (ResponseTagger $ tagHandler ): void
3832 {
39- $ value = new ContentInfo ([
40- 'id ' => 123 ,
41- 'mainLocationId ' => 456 ,
42- 'contentTypeId ' => 987 ,
43- ]);
33+ $ value = new ContentInfo (['id ' => 123 , 'contentTypeId ' => 987 ]);
4434
4535 $ this ->tag ($ value );
4636
@@ -49,11 +39,7 @@ public function it_tags_with_content_and_content_type_id(ResponseTagger $tagHand
4939
5040 public function it_tags_with_location_id_if_one_is_set (ResponseTagger $ tagHandler ): void
5141 {
52- $ value = new ContentInfo ([
53- 'id ' => 123 ,
54- 'mainLocationId ' => 456 ,
55- 'contentTypeId ' => 987 ,
56- ]);
42+ $ value = new ContentInfo (['mainLocationId ' => 456 ]);
5743
5844 $ this ->tag ($ value );
5945
0 commit comments