- Add Symfony 7 support
- Add JUnit report
- Add command line argument to configure default http client configuration
- Fix allow self signed certificate not used
- [BC BREAK] HTTP test case now rely exclusively on amp http client (no more psr7 or psr18)
- Fix assertions count
- Add a new attribute to configure HttpClient (allow to set timeout)
- [BC BREAK] No more yield, use php fiber instead
- [BC BREAK] Make http test case as an option
- [BC BREAK] No more global test case case
- [BC BREAK] Use PHP attribute instead of annotation
- Add a new test case trait for API
The API for asynit has changed, you need to update your test cases.
<?php
class HttpbinTest extends \Asynit\TestCase
{
/** @\Asynit\Annotation\Depend('getToken') */
public function testGet($token)
{
$response = yield $this->get('https://httpbin.org');
$response = yield $this->get('http://httpbin.org', ['Authorization' => 'Bearer {token}']);
$this->assertStatusCode(200, $response);
}
public function getToken()
{
return 'my_token';
}
}
<?php
#[\Asynit\Attribute\TestCase]
class HttpbinTest
{
use \Asynit\HttpClient\HttpClientWebCaseTrait;
#[\Asynit\Attribute\Depend('getToken')]
public function testGet($token)
{
$response = $this->get('http://httpbin.org', ['Authorization' => 'Bearer {token}']);
$this->assertStatusCode(200, $response);
}
public function getToken()
{
return 'my_token';
}
}