Created
April 20, 2020 20:55
-
-
Save jtelesforoantonio/2d819fa32aedde76e8bcdd03725d18cd to your computer and use it in GitHub Desktop.
Test Interfaces REST API with Laravel
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 Tests\Feature\Contracts; | |
interface DeleteTestInterface | |
{ | |
/** | |
* Unauthorized to delete an item. | |
* | |
* @return void | |
*/ | |
public function testDeleteUnauthorized(): void; | |
/** | |
* Forbidden to delete an item. | |
* | |
* @return void | |
*/ | |
public function testDeleteForbidden(): void; | |
/** | |
* Item not found . | |
* | |
* @return void | |
*/ | |
public function testDeleteNotFound(): void; | |
/** | |
* Successfully to delete an item. | |
* | |
* @return void | |
*/ | |
public function testDeleteSuccess(): void; | |
} |
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 Tests\Feature\Contracts; | |
interface IndexTestInterface | |
{ | |
/** | |
* Unauthorized to get index. | |
* | |
* @return void | |
*/ | |
public function testIndexUnauthorized(): void; | |
/** | |
* Forbidden to get index. | |
* | |
* @return void | |
*/ | |
public function testIndexForbidden(): void; | |
/** | |
* Successfully to get index. | |
* | |
* @return void | |
*/ | |
public function testIndexSuccess(): void; | |
} |
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 Tests\Feature\Contracts; | |
interface PostTestInterface | |
{ | |
/** | |
* Unauthorized to create an item. | |
* | |
* @return void | |
*/ | |
public function testPostUnauthorized(): void; | |
/** | |
* Forbidden to create an item. | |
* | |
* @return void | |
*/ | |
public function testPostForbidden(): void; | |
/** | |
* Fields required. | |
* | |
* @return void | |
*/ | |
public function testPostFieldsRequired(): void; | |
/** | |
* Successfully to create an item. | |
* | |
* @return void | |
*/ | |
public function testPostSuccess(): void; | |
} |
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 Tests\Feature\Contracts; | |
interface ShowTestInterface | |
{ | |
/** | |
* Unauthorized to get an item. | |
* | |
* @return void | |
*/ | |
public function testShowUnauthorized(): void; | |
/** | |
* Forbidden to get an item. | |
* | |
* @return void | |
*/ | |
public function testShowForbidden(): void; | |
/** | |
* Item not found. | |
* | |
* @return void | |
*/ | |
public function testShowNotFound():void; | |
/** | |
* Successfully to get an item. | |
* | |
* @return void | |
*/ | |
public function testShowSuccess(): void; | |
} |
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 Tests\Feature\Contracts; | |
interface UpdateTestInterface | |
{ | |
/** | |
* Unauthorized to update an item. | |
* | |
* @return void | |
*/ | |
public function testUpdateUnauthorized(): void; | |
/** | |
* Forbidden to update an item. | |
* | |
* @return void | |
*/ | |
public function testUpdateForbidden(): void; | |
/** | |
* Fields required. | |
* | |
* @return void | |
*/ | |
public function testUpdateFieldsRequired(): void; | |
/** | |
* Successfully to update an item. | |
* | |
* @return void | |
*/ | |
public function testUpdateSuccess(): void; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment