Code Duplication    Length = 20-20 lines in 2 locations

test/functional/RequestFunctionalTest.php 2 locations

@@ 33-52 (lines=20) @@
30
        }
31
    }
32
33
    public function testConcatRequest()
34
    {
35
        $id = 123;
36
        $method = 'concat';
37
        $params = ['foo'=>'abc', 'bar'=>'def'];
38
        $request = $this->client->request($id, $method, $params);
39
        $response = $this->client->send($request);
40
41
        $this->assertEquals(ClientInterface::SPEC, $request->getRpcVersion());
42
        $this->assertEquals($id, $request->getRpcId());
43
        $this->assertEquals($method, $request->getRpcMethod());
44
        $this->assertEquals($params, $request->getRpcParams());
45
46
        $this->assertEquals(ClientInterface::SPEC, $response->getRpcVersion());
47
        $this->assertEquals(implode('', $params), $response->getRpcResult());
48
        $this->assertEquals($id, $response->getRpcId());
49
        $this->assertEquals(null, $response->getRpcErrorCode());
50
        $this->assertEquals(null, $response->getRpcErrorMessage());
51
        $this->assertEquals(null, $response->getRpcErrorData());
52
    }
53
54
    public function testConcatAsyncRequest()
55
    {
@@ 77-96 (lines=20) @@
74
        });
75
    }
76
77
    public function testSumRequest()
78
    {
79
        $id = 'abc';
80
        $method = 'sum';
81
        $params = ['foo'=>123, 'bar'=>456];
82
        $request = $this->client->request($id, $method, $params);
83
        $response = $this->client->send($request);
84
85
        $this->assertEquals(ClientInterface::SPEC, $request->getRpcVersion());
86
        $this->assertEquals($id, $request->getRpcId());
87
        $this->assertEquals($method, $request->getRpcMethod());
88
        $this->assertEquals($params, $request->getRpcParams());
89
90
        $this->assertEquals(ClientInterface::SPEC, $response->getRpcVersion());
91
        $this->assertEquals(array_sum($params), $response->getRpcResult());
92
        $this->assertEquals($id, $response->getRpcId());
93
        $this->assertEquals(null, $response->getRpcErrorCode());
94
        $this->assertEquals(null, $response->getRpcErrorMessage());
95
        $this->assertEquals(null, $response->getRpcErrorData());
96
    }
97
98
    public function testSumAsyncRequest()
99
    {