Passed
Push — master ( 4d1653...b0c9fc )
by Jared
03:43
created

JCRequestTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
ccs 3
cts 3
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: jaredchu
6
 * Date: 31/05/2017
7
 * Time: 10:14
8
 */
9
10
use JC\JCRequest;
11
12
class JCRequestTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
13
{
14 1
    public function testGet()
15
    {
16 1
        $url = 'https://httpbin.org/get';
17
18 1
        $response = JCRequest::get($url);
19 1
        $this->assertEquals(200, $response->status());
20 1
        $this->assertNotEmpty($response->body());
21 1
    }
22
23 2
    public function testPost()
24
    {
25 1
        $url = 'https://httpbin.org/post';
26
27 1
        $response = JCRequest::post($url, [], ['hello' => 'world']);
28 2
        $this->assertEquals(200, $response->status());
29 2
        $this->assertNotEmpty($response->body());
30
    }
31
}