Created
December 30, 2015 12:29
-
-
Save pjedrzejewski/fff27d957276a9aa4583 to your computer and use it in GitHub Desktop.
This file contains 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 | |
{ | |
/** | |
* @test | |
*/ | |
public function shouldCreateAProduct() | |
{ | |
$data = | |
<<<EOT | |
{ | |
"price": 50, | |
"sku": "SWTS", | |
"name": "Star Wars T-Shirt" | |
} | |
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