Merge branch '5.2' into 5.x
* 5.2: [Notifier] Fix tests [HttpFoundation] keep turning dots to underscores when using Request::create()
This commit is contained in:
commit
7013f23b08
@ -405,7 +405,7 @@ class Request
|
|||||||
|
|
||||||
$queryString = '';
|
$queryString = '';
|
||||||
if (isset($components['query'])) {
|
if (isset($components['query'])) {
|
||||||
$qs = HeaderUtils::parseQuery(html_entity_decode($components['query']));
|
parse_str(html_entity_decode($components['query']), $qs);
|
||||||
|
|
||||||
if ($query) {
|
if ($query) {
|
||||||
$query = array_replace($qs, $query);
|
$query = array_replace($qs, $query);
|
||||||
|
@ -123,13 +123,14 @@ class RequestTest extends TestCase
|
|||||||
$this->assertEquals('test.com', $request->getHttpHost());
|
$this->assertEquals('test.com', $request->getHttpHost());
|
||||||
$this->assertFalse($request->isSecure());
|
$this->assertFalse($request->isSecure());
|
||||||
|
|
||||||
$request = Request::create('https://test.com/foo?bar=baz');
|
$request = Request::create('https://test.com/foo?foo.bar=baz');
|
||||||
$this->assertEquals('https://test.com/foo?bar=baz', $request->getUri());
|
$this->assertEquals('https://test.com/foo?foo.bar=baz', $request->getUri());
|
||||||
$this->assertEquals('/foo', $request->getPathInfo());
|
$this->assertEquals('/foo', $request->getPathInfo());
|
||||||
$this->assertEquals('bar=baz', $request->getQueryString());
|
$this->assertEquals('foo.bar=baz', $request->getQueryString());
|
||||||
$this->assertEquals(443, $request->getPort());
|
$this->assertEquals(443, $request->getPort());
|
||||||
$this->assertEquals('test.com', $request->getHttpHost());
|
$this->assertEquals('test.com', $request->getHttpHost());
|
||||||
$this->assertTrue($request->isSecure());
|
$this->assertTrue($request->isSecure());
|
||||||
|
$this->assertSame(['foo_bar' => 'baz'], $request->query->all());
|
||||||
|
|
||||||
$request = Request::create('test.com:90/foo');
|
$request = Request::create('test.com:90/foo');
|
||||||
$this->assertEquals('http://test.com:90/foo', $request->getUri());
|
$this->assertEquals('http://test.com:90/foo', $request->getUri());
|
||||||
|
@ -79,11 +79,12 @@ final class TelegramTransport extends AbstractTransport
|
|||||||
$options['chat_id'] = $message->getRecipientId() ?: $this->chatChannel;
|
$options['chat_id'] = $message->getRecipientId() ?: $this->chatChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$options['text'] = $message->getSubject();
|
||||||
|
|
||||||
if (!isset($options['parse_mode'])) {
|
if (!isset($options['parse_mode'])) {
|
||||||
$options['parse_mode'] = TelegramOptions::PARSE_MODE_MARKDOWN_V2;
|
$options['parse_mode'] = TelegramOptions::PARSE_MODE_MARKDOWN_V2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$options['text'] = $message->getSubject();
|
|
||||||
$response = $this->client->request('POST', $endpoint, [
|
$response = $this->client->request('POST', $endpoint, [
|
||||||
'json' => array_filter($options),
|
'json' => array_filter($options),
|
||||||
]);
|
]);
|
||||||
|
Reference in New Issue
Block a user