TestingServiceClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 41
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequestUriPublic() 0 3 1
A sendRequest() 0 3 1
1
<?php
2
namespace Mezon\Service\Tests;
3
4
use Mezon\Service\ServiceClient;
5
6
/**
7
 * Class ServiceClientUnitTests
8
 *
9
 * @package ServiceClient
10
 * @subpackage ServiceClientUnitTests
11
 * @author Dodonov A.A.
12
 * @version v.1.0 (2019/09/20)
13
 * @copyright Copyright (c) 2019, aeon.org
14
 */
15
class TestingServiceClient extends ServiceClient
16
{
17
18
    /**
19
     * Method returns concrete url by it's locator
20
     *
21
     * @param string $urlLocator
22
     *            url locator
23
     * @return string concrete URL
24
     */
25
    public function getRequestUriPublic(string $urlLocator): string
26
    {
27
        return $this->getRequestUrl($urlLocator);
28
    }
29
30
    /**
31
     * Result of the sendRequest method
32
     *
33
     * @var array
34
     */
35
    public $sendRequestResult = [
36
        'body',
37
        1
38
    ];
39
40
    /**
41
     *
42
     * @param string $url
43
     *            URL
44
     * @param array $headers
45
     *            Headers
46
     * @param string $method
47
     *            Request HTTP Method
48
     * @param array $data
49
     *            Request data
50
     * @return array Response body and HTTP code
51
     * @codeCoverageIgnore
52
     */
53
    protected function sendRequest(string $url, array $headers, string $method, array $data = []): array
54
    {
55
        return $this->sendRequestResult;
56
    }
57
}
58