mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 10:17:39 +08:00
Added test case.
This commit is contained in:
parent
1ca339fa06
commit
463d048bb0
@ -1,5 +1,9 @@
|
||||
# v1.1.33 - TBD
|
||||
|
||||
## Fixed
|
||||
|
||||
- [#1917](https://github.com/hyperf/hyperf/pull/1917) Fixed bug that `Request::isXmlHttpRequest` does not work.
|
||||
|
||||
## Optimized
|
||||
|
||||
- [#1793](https://github.com/hyperf/hyperf/pull/1793) Socket.io server now only dispatch connect/disconnect events in onOpen and onClose. Also upgrade some class members from private to protected, so users can hack them.
|
||||
|
@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace HyperfTest\HttpMessage;
|
||||
|
||||
use Hyperf\HttpMessage\Base\Request;
|
||||
use Hyperf\HttpMessage\Server\Request as ServerRequest;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@ -38,4 +39,13 @@ class MessageTraitTest extends TestCase
|
||||
$this->assertSame('1000', $request->getHeaderLine('1000'));
|
||||
$this->assertSame('XMLHttpRequest', $request->getHeaderLine('X-Requested-With'));
|
||||
}
|
||||
|
||||
public function testIsXmlHttpRequest()
|
||||
{
|
||||
$request = new ServerRequest('GET', '/', [
|
||||
'X-Requested-With' => 'XMLHttpRequest',
|
||||
]);
|
||||
|
||||
$this->assertTrue($request->isXmlHttpRequest());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user