. */ declare(strict_types=1); namespace App\Tests\API\Endpoints; use App\Tests\API\Endpoints\CrudEndpointTestCase; class PartAssociationsEndpointTest extends CrudEndpointTestCase { protected function getBasePath(): string { return '/api/part_associations'; } public function testGetCollection(): void { $this->_testGetCollection(); self::assertJsonContains([ 'hydra:totalItems' => 0, ]); } public function testLifeCycle(): void { $response = $this->_testPostItem([ "owner" => '/api/parts/1', "other" => '/api/parts/2', 'type' => 1, ]); $id = $this->getIdOfCreatedElement($response); $this->_testGetItem($id); $this->_testPatchItem($id, [ 'comment' => 'Test comment' ]); $this->_testDeleteItem($id); } }