Skip to content

[FrameworkBundle][HttpFoundation] add assertResponseFormatSame() #39666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Dec 31, 2020

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix n/a
License MIT
Doc PR todo

Add a new PHPUnit assertion checking the format of the HTTP request.

Example:

namespace App\Tests;

use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase;
use App\Entity\Book;

class BooksTest extends ApiTestCase
{
    public function testGetCollection(): void
    {
        static::createClient()->request('GET', '/books');
        $this->assertResponseFormatSame('jsonld');
    }
}

@carsonbot carsonbot changed the title [HttpFoundation][FrameworkBundle] add assertResponseFormatSame() [HttpFoundation] [FrameworkBundle] add assertResponseFormatSame() Dec 31, 2020
@carsonbot carsonbot changed the title [HttpFoundation] [FrameworkBundle] add assertResponseFormatSame() [FrameworkBundle][HttpFoundation] add assertResponseFormatSame() Dec 31, 2020
@dunglas dunglas force-pushed the feat/assertResponseFormatSame branch from 4417a32 to 6ef1ed1 Compare December 31, 2020 00:22
@fabpot fabpot force-pushed the feat/assertResponseFormatSame branch from 3d3a6f7 to 8fffa2c Compare January 3, 2021 08:13
@fabpot
Copy link
Member

fabpot commented Jan 3, 2021

Thank you @dunglas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants