public function testCanAccessRequestInfoFromRequest() { $requestInfo = RequestInfo::fromEnv(); $postRequest = new PostRequest($requestInfo, [], []); $command = new TestDomainCommand($postRequest); $this->assertSame($requestInfo, $command->getRequestInfo()); }
public function testCanAccessRawDataFromRequest() { stream_wrapper_unregister("php"); stream_wrapper_register("php", PhpStreamMock::class); file_put_contents('php://input', 'Unit-Test'); $postRequest = new PostRequest([], []); $command = new TestDomainCommand($postRequest); $this->assertEquals('Unit-Test', $command->getBody()); stream_wrapper_restore("php"); }