Code Duplication    Length = 10-10 lines in 2 locations

test/unit/Middleware/RpcErrorMiddlewareTest.php 2 locations

@@ 42-51 (lines=10) @@
39
    /**
40
     * @expectedException \Graze\GuzzleHttp\JsonRpc\Exception\ClientException
41
     */
42
    public function testApplyResponseThrowsClientException()
43
    {
44
        $this->response->shouldReceive('getRpcErrorCode')->times(2)->withNoArgs()->andReturn(-32600);
45
        $this->request->shouldReceive('getRequestTarget')->once()->withNoArgs()->andReturn('http://foo');
46
        $this->request->shouldReceive('getRpcMethod')->once()->withNoArgs()->andReturn('foo');
47
        $this->response->shouldReceive('getRpcErrorMessage')->once()->withNoArgs()->andReturn('bar');
48
        $this->response->shouldReceive('getStatusCode')->once()->withNoArgs()->andReturn(200);
49
50
        $this->middleware->applyResponse($this->request, $this->response, ['rpc_error' => true]);
51
    }
52
53
    /**
54
     * @expectedException \Graze\GuzzleHttp\JsonRpc\Exception\ServerException
@@ 56-65 (lines=10) @@
53
    /**
54
     * @expectedException \Graze\GuzzleHttp\JsonRpc\Exception\ServerException
55
     */
56
    public function testApplyResponseThrowsServerException()
57
    {
58
        $this->response->shouldReceive('getRpcErrorCode')->times(2)->withNoArgs()->andReturn(-32000);
59
        $this->request->shouldReceive('getRequestTarget')->once()->withNoArgs()->andReturn('http://foo');
60
        $this->request->shouldReceive('getRpcMethod')->once()->withNoArgs()->andReturn('foo');
61
        $this->response->shouldReceive('getRpcErrorMessage')->once()->withNoArgs()->andReturn('bar');
62
        $this->response->shouldReceive('getStatusCode')->once()->withNoArgs()->andReturn(200);
63
64
        $this->middleware->applyResponse($this->request, $this->response, ['rpc_error' => true]);
65
    }
66
67
    public function testApplyResponseNoError()
68
    {