for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: jaredchu
* Date: 31/05/2017
* Time: 10:14
*/
use JC\JCRequest;
class JCRequestTest extends PHPUnit_Framework_TestCase
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.
{
public function testGet()
$url = 'https://httpbin.org/get';
$response = JCRequest::get($url);
$this->assertEquals(200, $response->status());
$this->assertNotEmpty($response->body());
}
public function testPost()
$url = 'https://httpbin.org/post';
$response = JCRequest::post($url, [], ['hello' => 'world']);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.