ROAResearch /
yii2-roa
| 1 | <?php |
||
| 2 | |||
| 3 | namespace roaresearch\yii2\roa\test; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * Interface to test ROA resources services. |
||
| 7 | * |
||
| 8 | * @author Angel (Faryshta) Guevara <[email protected]> |
||
| 9 | */ |
||
| 10 | interface Tester |
||
| 11 | { |
||
| 12 | public const HAL_JSON_CONTENT_TYPE = 'application/hal+json; charset=UTF-8'; |
||
| 13 | |||
| 14 | public const HAL_XML_CONTENT_TYPE = 'application/hal+xml; charset=UTF-8'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Saves a token identified by an unique name. |
||
| 18 | * |
||
| 19 | * @param string $tokenName unique name to identify the tokens. |
||
| 20 | * @param string $token oauth2 authorization token |
||
| 21 | */ |
||
| 22 | public function storeToken(string $tokenName, string $token); |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Authenticates a user stored in `$tokens` |
||
| 26 | * |
||
| 27 | * @param string $tokenName |
||
| 28 | */ |
||
| 29 | public function amAuthByToken(string $tokenName); |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Checks over the HTTP pagination headers and (optionally) its values. |
||
| 33 | */ |
||
| 34 | public function seePaginationHttpHeaders(); |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Checks over the HTTP content type header value. |
||
| 38 | */ |
||
| 39 | public function seeContentTypeHttpHeader( |
||
| 40 | string $contentType = self::HAL_CONTENT_TYPE |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 41 | ); |
||
| 42 | } |
||
| 43 |