Mercurial > hg > isophonics-drupal-site
comparison core/modules/rest/tests/src/Functional/ResourceTest.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 129ea1e6d783 |
children |
comparison
equal
deleted
inserted
replaced
17:129ea1e6d783 | 18:af1871eacc83 |
---|---|
70 ], | 70 ], |
71 ], | 71 ], |
72 ])->save(); | 72 ])->save(); |
73 | 73 |
74 // Verify that accessing the resource returns 406. | 74 // Verify that accessing the resource returns 406. |
75 $this->drupalGet($this->entity->urlInfo()->setRouteParameter('_format', 'hal_json')); | 75 $this->drupalGet($this->entity->toUrl()->setRouteParameter('_format', 'hal_json')); |
76 // \Drupal\Core\Routing\RequestFormatRouteFilter considers the canonical, | 76 // \Drupal\Core\Routing\RequestFormatRouteFilter considers the canonical, |
77 // non-REST route a match, but a lower quality one: no format restrictions | 77 // non-REST route a match, but a lower quality one: no format restrictions |
78 // means there's always a match and hence when there is no matching REST | 78 // means there's always a match and hence when there is no matching REST |
79 // route, the non-REST route is used, but can't render into | 79 // route, the non-REST route is used, but can't render into |
80 // application/hal+json, so it returns a 406. | 80 // application/hal+json, so it returns a 406. |
96 ], | 96 ], |
97 ], | 97 ], |
98 ])->save(); | 98 ])->save(); |
99 | 99 |
100 // Verify that accessing the resource returns 401. | 100 // Verify that accessing the resource returns 401. |
101 $this->drupalGet($this->entity->urlInfo()->setRouteParameter('_format', 'hal_json')); | 101 $this->drupalGet($this->entity->toUrl()->setRouteParameter('_format', 'hal_json')); |
102 // \Drupal\Core\Routing\RequestFormatRouteFilter considers the canonical, | 102 // \Drupal\Core\Routing\RequestFormatRouteFilter considers the canonical, |
103 // non-REST route a match, but a lower quality one: no format restrictions | 103 // non-REST route a match, but a lower quality one: no format restrictions |
104 // means there's always a match and hence when there is no matching REST | 104 // means there's always a match and hence when there is no matching REST |
105 // route, the non-REST route is used, but can't render into | 105 // route, the non-REST route is used, but can't render into |
106 // application/hal+json, so it returns a 406. | 106 // application/hal+json, so it returns a 406. |