for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Containers\User\UI\API\Tests\Functional;
use App\Containers\User\Models\User;
use App\Port\Test\PHPUnit\Abstracts\TestCase;
/**
* Class GetUsersTest.
*
* @author Mahmoud Zalt <[email protected]>
*/
class GetUserTest extends TestCase
{
protected $endpoint = '/users/{id}';
public function testGetUser_()
$admin = $this->getTestingAdmin();
// send the HTTP request
$response = $this->apiCall($this->injectEndpointId($this->endpoint, $admin->id), 'get', [], true);
// assert response status is correct
$this->assertEquals('200', $response->getStatusCode());
$responseObject = $this->getResponseObject($response);
$this->assertEquals($admin->name, $responseObject->data->name);
}