QueryList/tests/Feature/HttpTest.php

41 lines
734 B
PHP
Raw Normal View History

2018-12-10 01:27:48 +08:00
<?php
/**
* Created by PhpStorm.
* User: x
* Date: 2018/12/10
* Time: 12:35 AM
*/
namespace Tests\Feature;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\Psr7\Response;
use QL\QueryList;
use Tests\TestCaseBase;
class HttpTest extends TestCaseBase
{
/**
* @test
*/
public function can_post_json_data()
{
$mock = new MockHandler([new Response()]);
$data = [
'name' => 'foo'
];
QueryList::postJson('http://foo.com',$data,[
'handler' => $mock
]);
$this->assertEquals((string)$mock->getLastRequest()->getBody(),json_encode($data));
}
2018-12-11 00:00:17 +08:00
/**
* @test
*/
public function concurrent_requests()
{
}
2018-12-10 01:27:48 +08:00
}