mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
Support smart quotes in mentions format
This commit is contained in:
@@ -156,6 +156,37 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function mentioning_a_valid_user_with_new_format_with_smart_quotes_works()
|
||||
{
|
||||
$response = $this->send(
|
||||
$this->request('POST', '/api/posts', [
|
||||
'authenticatedAs' => 1,
|
||||
'json' => [
|
||||
'data' => [
|
||||
'attributes' => [
|
||||
'content' => '@“POTATO$”#3',
|
||||
],
|
||||
'relationships' => [
|
||||
'discussion' => ['data' => ['id' => 2]],
|
||||
],
|
||||
],
|
||||
],
|
||||
])
|
||||
);
|
||||
|
||||
$this->assertEquals(201, $response->getStatusCode());
|
||||
|
||||
$response = json_decode($response->getBody(), true);
|
||||
|
||||
$this->assertStringContainsString('@POTATO$', $response['data']['attributes']['contentHtml']);
|
||||
$this->assertStringContainsString('@"POTATO$"#3', $response['data']['attributes']['content']);
|
||||
$this->assertStringContainsString('UserMention', $response['data']['attributes']['contentHtml']);
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
Reference in New Issue
Block a user