Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
\Drupal\Tests\rest\Functional\ResourceTestBase::assertResourceResponse
contains
if ($expected_status_code < 400) {
$this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
}
else {
$this->assertSame([static::$mimeType], $response->getHeader('Content-Type'));
}
The code is the same for the if and the else block.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2905181-2.patch | 1 KB | tedbow |
Comments
Comment #2
tedbowComment #3
tedbowMarking as 'Novice'.
It looks this problem was introduced in #2805281-10: ?_format=hal_json error responses are application/json, yet should be application/hal+json
The previous block was
But then in that issue
static::$expectedErrorMimeType
was no longer needed. So maybe just replace error.Comment #5
tedbowSetting back to needs review. #2 had a totally unrelated error. Not sure why
Comment #6
Wim LeersYep, the two branches of that if-test used to be different. As of #2805281: ?_format=hal_json error responses are application/json, yet should be application/hal+json, that bug in D8 has been fixed. But #2805281 forgot to simplify this code accordingly.
Comment #7
dawehnerSimplifying code, works for me :)
Comment #8
Wim Leers+1.
I stupidly didn't even notice the patch was ready — based on #3 adding that tag, I assumed it needed work :P
Comment #9
tedbow@Wim Leers yep sorry I added the tag because I thought a novice could mark it RTBC.
Comment #10
Wim LeersAhh! :) Np in any case.
Comment #14
xjmlol nice. Committed and pushed to 8.5.x and backported to 8.4.x as a test code cleanup. Thanks!