1. Go to this page and download the library: Download lchrusciel/api-test-case library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lchrusciel / api-test-case example snippets
namespace AppBundle\Tests\Controller\HelloWorldTest;
use ApiTestCase\JsonApiTestCase;
class HelloWorldTest extends JsonApiTestCase
{
public function testGetHelloWorldResponse()
{
$this->client->request('GET', '/');
$response = $this->client->getResponse();
$this->assertResponse($response, 'hello_world');
}
}
class Book
{
private $id;
private $title;
private $author;
// ...
}
public function testBooksIndexAction()
{
// This method here is another method that allows you to load fixtures from directory.
$this->loadFixturesFromDirectory('big_library');
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.