1. Go to this page and download the library: Download nebkam/fluent-test 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/ */
// Before
$response = $client->request($method, $uri, $parameters, $files, $server, json_encode($content));
// After
$response = RequestBuilder::create($client)
->setJsonContent($content)
...
// This works
$response = RequestBuilder::create($client)
->setUri('/users/'. $email .'/details')
...
// This is more readable
$response = RequestBuilder::create($client)
->setUri('/users/%s/details', $email)
...
// Before
$client->request($method, $uri, $parameters, $files, $server, $content);
$response = $client->getResponse();
$this->assertEquals(200,$response->getStatusCode())
// After
$response = RequestBuilder::create($client)
...
->getResponse();
$this->assertTrue($response->isOk());