Created
August 17, 2017 14:16
-
-
Save cassianotartari/eaeba2e7ead588771170c79715abef1f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Tests\Controller; | |
use Lakion\ApiTestCase\JsonApiTestCase; | |
use Symfony\Component\HttpFoundation\Response; | |
class ProductApiTest extends JsonApiTestCase | |
{ | |
function testCreatePostResponse() | |
{ | |
$data = | |
<<<EOT | |
{ | |
"name": "Star Wars T-Shirt", | |
"sku": "SWTS", | |
"price": 50 | |
} | |
EOT; | |
$this->client->request('POST', '/products/', [], [], [ | |
'CONTENT_TYPE' => 'application/json', | |
], $data); | |
$response = $this->client->getResponse(); | |
$this->assertResponse($response, 'products/create_response' , Response::HTTP_CREATED); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment