@@ -39,6 +39,7 @@ public function testConstruct()
39
39
/**
40
40
* @expectedException \ApiPlatform\Core\Exception\InvalidArgumentException
41
41
* @expectedExceptionMessage No item route associated with the type "AppBundle\Entity\User".
42
+ * @group legacy
42
43
*/
43
44
public function testGetRouteNameForItemRouteWithNoMatchingRoute ()
44
45
{
@@ -50,14 +51,17 @@ public function testGetRouteNameForItemRouteWithNoMatchingRoute()
50
51
$ cacheItemPoolProphecy ->save ($ cacheItemProphecy )->shouldNotBeCalled ();
51
52
52
53
$ decoratedProphecy = $ this ->prophesize (RouteNameResolverInterface::class);
53
- $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , false )
54
+ $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , false , [] )
54
55
->willThrow (new InvalidArgumentException ('No item route associated with the type "AppBundle\Entity\User". ' ))
55
56
->shouldBeCalled ();
56
57
57
58
$ cachedRouteNameResolver = new CachedRouteNameResolver ($ cacheItemPoolProphecy ->reveal (), $ decoratedProphecy ->reveal ());
58
59
$ cachedRouteNameResolver ->getRouteName ('AppBundle\Entity\User ' , false );
59
60
}
60
61
62
+ /**
63
+ * @group legacy
64
+ */
61
65
public function testGetRouteNameForItemRouteOnCacheMiss ()
62
66
{
63
67
$ cacheItemProphecy = $ this ->prophesize (CacheItemInterface::class);
@@ -69,7 +73,7 @@ public function testGetRouteNameForItemRouteOnCacheMiss()
69
73
$ cacheItemPoolProphecy ->save ($ cacheItemProphecy )->willReturn (true )->shouldBeCalled ();
70
74
71
75
$ decoratedProphecy = $ this ->prophesize (RouteNameResolverInterface::class);
72
- $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , false )->willReturn ('some_item_route ' )->shouldBeCalled ();
76
+ $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , false , [] )->willReturn ('some_item_route ' )->shouldBeCalled ();
73
77
74
78
$ cachedRouteNameResolver = new CachedRouteNameResolver ($ cacheItemPoolProphecy ->reveal (), $ decoratedProphecy ->reveal ());
75
79
$ actual = $ cachedRouteNameResolver ->getRouteName ('AppBundle\Entity\User ' , false );
@@ -99,6 +103,7 @@ public function testGetRouteNameForItemRouteOnCacheHit()
99
103
/**
100
104
* @expectedException \ApiPlatform\Core\Exception\InvalidArgumentException
101
105
* @expectedExceptionMessage No collection route associated with the type "AppBundle\Entity\User".
106
+ * @group legacy
102
107
*/
103
108
public function testGetRouteNameForCollectionRouteWithNoMatchingRoute ()
104
109
{
@@ -110,14 +115,17 @@ public function testGetRouteNameForCollectionRouteWithNoMatchingRoute()
110
115
$ cacheItemPoolProphecy ->save ($ cacheItemProphecy )->shouldNotBeCalled ();
111
116
112
117
$ decoratedProphecy = $ this ->prophesize (RouteNameResolverInterface::class);
113
- $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , true )
118
+ $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , true , [] )
114
119
->willThrow (new InvalidArgumentException ('No collection route associated with the type "AppBundle\Entity\User". ' ))
115
120
->shouldBeCalled ();
116
121
117
122
$ cachedRouteNameResolver = new CachedRouteNameResolver ($ cacheItemPoolProphecy ->reveal (), $ decoratedProphecy ->reveal ());
118
123
$ cachedRouteNameResolver ->getRouteName ('AppBundle\Entity\User ' , true );
119
124
}
120
125
126
+ /**
127
+ * @group legacy
128
+ */
121
129
public function testGetRouteNameForCollectionRouteOnCacheMiss ()
122
130
{
123
131
$ cacheItemProphecy = $ this ->prophesize (CacheItemInterface::class);
@@ -129,7 +137,7 @@ public function testGetRouteNameForCollectionRouteOnCacheMiss()
129
137
$ cacheItemPoolProphecy ->save ($ cacheItemProphecy )->willReturn (true )->shouldBeCalled ();
130
138
131
139
$ decoratedProphecy = $ this ->prophesize (RouteNameResolverInterface::class);
132
- $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , true )->willReturn ('some_collection_route ' )->shouldBeCalled ();
140
+ $ decoratedProphecy ->getRouteName ('AppBundle\Entity\User ' , true , [] )->willReturn ('some_collection_route ' )->shouldBeCalled ();
133
141
134
142
$ cachedRouteNameResolver = new CachedRouteNameResolver ($ cacheItemPoolProphecy ->reveal (), $ decoratedProphecy ->reveal ());
135
143
$ actual = $ cachedRouteNameResolver ->getRouteName ('AppBundle\Entity\User ' , true );
0 commit comments