Source of file BindableTestRequest.php

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

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
<?php
/**
 * Created by PhpStorm.
 * User: aaflalo
 * Date: 18-06-01
 * Time: 15:38.
 */

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

use ZEROSPAM\Framework\SDK\Request\Api\BaseRequest;
use ZEROSPAM\Framework\SDK\Request\Api\IsBindable;
use ZEROSPAM\Framework\SDK\Request\Type\RequestType;
use ZEROSPAM\Framework\SDK\Response\Api\IResponse;
use ZEROSPAM\Framework\SDK\Test\Tests\Utils\Obj\BasicEnum;

/**
 * Class BindableTestRequest
 *
 * Test Request to test Binding URL
 *
 * @package ZEROSPAM\Framework\SDK\Test\Base\Request
 */
class BindableTestRequest extends BaseRequest
{
    use IsBindable;

    private $test;

    /**
     * @param mixed $test
     *
     * @return $this
     */
    public function setTest($test)
    {
        $this->test = $test;

        return $this;
    }

    /**
     * CAN'T OVERRIDE.
     *
     * @param $id
     *
     * @return $this
     */
    public function setNiceId($id)
    {
        $this->addBinding('niceId', $id, false);

        return $this;
    }

    public function setTestId($id)
    {
        $this->addBinding('testId', $id);

        return $this;
    }

    public function setTestEnum(BasicEnum $enum)
    {
        $this->addBinding('testId', $enum);

        return $this;
    }

    /**
     * Base route without binding.
     *
     * @return string
     */
    public function baseRoute(): string
    {
        return 'test/:testId/nice/:niceId';
    }

    /**
     * Type of request.
     *
     * @return RequestType
     */
    public function httpType(): RequestType
    {
        // TODO: Implement httpType() method.
    }

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