Source of file TestRequest.php

Size: 1,122 Bytes - Last Modified: 2019-08-09T18:27:54+00:00

/home/travis/build/zerospam/sdk-framework/tests/src/Base/Data/Request/TestRequest.php

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
<?php
/**
 * Created by PhpStorm.
 * User: aaflalo
 * Date: 18-06-01
 * Time: 14:18.
 */

namespace ZEROSPAM\Framework\SDK\Test\Base\Data\Request;

use ZEROSPAM\Framework\SDK\Request\Api\BaseRequest;
use ZEROSPAM\Framework\SDK\Request\Type\RequestType;
use ZEROSPAM\Framework\SDK\Response\Api\IResponse;
use ZEROSPAM\Framework\SDK\Test\Base\Data\Response\TestResponse;

/**
 * Class TestRequest.
 *
 * Test request
 * @method TestResponse getResponse()
 */
class TestRequest extends BaseRequest
{
    /**
     * The url of the route.
     *
     * @return string
     */
    public function routeUrl(): string
    {
        return 'test';
    }

    /**
     * Type of request.
     *
     * @return RequestType
     */
    public function httpType(): RequestType
    {
        return RequestType::HTTP_GET();
    }

    /**
     * Process the data that is in the response.
     *
     * @param array $jsonResponse
     *
     * @return \ZEROSPAM\Framework\SDK\Response\Api\IResponse
     */
    public function processResponse(array $jsonResponse): IResponse
    {
        return new TestResponse($jsonResponse);
    }
}