Ok, I resolved it.
I use Guzzle for this.
If somebody want knows how to do it I show my example code.
-
Install Guzzle. Add to your composer.json next "guzzle/guzzle":"~3.9" or use php composer.phar require guzzle/guzzle:~3.9
- My test Class extends UnitTestCase
Code example
class UserControllerTest extends \UnitTestCase
{
/**
* @covers Controllers\UserController::loginAction
*/
public function testLoginAction()
{
$client = new \Guzzle\Http\Client();
$nickname = 'User nickName';
$data = array(
'nickname' => $nickname,
'avatarNumber' => 5,
'tagLine' => 'a test dev!'
);
$request = $client->post('https://my_site_url/api/user/login', null, $data);
$response = $request->send();
$response->getBody(true);
}
}
It is simple example :)
That is all.
Thanks all.