Code Duplication    Length = 12-12 lines in 3 locations

test/units/Transport/ClientTest.php 3 locations

@@ 95-106 (lines=12) @@
92
        $this->assertInstanceOf('\Bee4\Transport\Message\Request\Http\Get', $response->getRequest());
93
    }
94
95
    public function testPost()
96
    {
97
        $request = $this->object->post('/index.html')->setBody('{"body": "I\'m the body"}}');
98
        $response = $request->send();
99
        $options = $request->getOptions();
100
101
        $this->assertArrayHasKey(CURLOPT_POST, $options);
102
        $this->assertArrayHasKey(CURLOPT_POSTFIELDS, $options);
103
        $this->assertTrue($options[CURLOPT_POST]);
104
        $this->assertEquals('{"body": "I\'m the body"}}', $options[CURLOPT_POSTFIELDS]);
105
        $this->assertInstanceOf('\Bee4\Transport\Message\Request\Http\Post', $response->getRequest());
106
    }
107
108
    public function testHead()
109
    {
@@ 119-130 (lines=12) @@
116
        $this->assertInstanceOf('\Bee4\Transport\Message\Request\Http\Head', $response->getRequest());
117
    }
118
119
    public function testDelete()
120
    {
121
        $request = $this->object->delete('/index.html');
122
        $response = $request->send();
123
        $options = $request->getOptions();
124
125
        $this->assertArrayHasKey(CURLOPT_CUSTOMREQUEST, $options);
126
        $this->assertArrayHasKey(CURLOPT_POSTFIELDS, $options);
127
        $this->assertEquals('DELETE', $options[CURLOPT_CUSTOMREQUEST]);
128
        $this->assertEquals(false, $options[CURLOPT_POSTFIELDS]);
129
        $this->assertInstanceOf('\Bee4\Transport\Message\Request\Http\Delete', $response->getRequest());
130
    }
131
132
    public function testPutFromString()
133
    {
@@ 132-143 (lines=12) @@
129
        $this->assertInstanceOf('\Bee4\Transport\Message\Request\Http\Delete', $response->getRequest());
130
    }
131
132
    public function testPutFromString()
133
    {
134
        $request = $this->object->put('/index.html');
135
        $response = $request->send();
136
        $options = $request->getOptions();
137
138
        $this->assertArrayHasKey(CURLOPT_CUSTOMREQUEST, $options);
139
        $this->assertArrayHasKey(CURLOPT_POSTFIELDS, $options);
140
        $this->assertEquals('PUT', $options[CURLOPT_CUSTOMREQUEST]);
141
        $this->assertEquals(false, $options[CURLOPT_POSTFIELDS]);
142
        $this->assertInstanceOf('\Bee4\Transport\Message\Request\Http\Put', $response->getRequest());
143
    }
144
145
    public function testPutFromStream()
146
    {