MCPcopy Create free account
hub / github.com/api-platform/website / GreetingsTest

Class GreetingsTest

api/tests/Api/GreetingsTest.php:7–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
6
7class GreetingsTest extends ApiTestCase
8{
9 public function testCreateGreeting(): void
10 {
11 static::createClient()->request('POST', '/greetings', ['json' => [
12 'name' => 'Kévin',
13 ]]);
14
15 $this->assertResponseStatusCodeSame(201);
16 $this->assertJsonContains([
17 '@context' => '/contexts/Greeting',
18 '@type' => 'Greeting',
19 'name' => 'Kévin',
20 ]);
21 }
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected