mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 12:43:52 +08:00
Tweak test name and add posts mention equivalent test
This commit is contained in:
parent
cc62044e6f
commit
b0a301229a
|
@ -126,6 +126,37 @@ class PostMentionsTest extends TestCase
|
|||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsPosts->find(4));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function mentioning_a_valid_post_with_new_format_with_smart_quotes_works_and_falls_back_to_normal_quotes()
|
||||
{
|
||||
$response = $this->send(
|
||||
$this->request('POST', '/api/posts', [
|
||||
'authenticatedAs' => 1,
|
||||
'json' => [
|
||||
'data' => [
|
||||
'attributes' => [
|
||||
'content' => '@“POTATO$”#p4',
|
||||
],
|
||||
'relationships' => [
|
||||
'discussion' => ['data' => ['id' => 2]],
|
||||
],
|
||||
],
|
||||
],
|
||||
])
|
||||
);
|
||||
|
||||
$this->assertEquals(201, $response->getStatusCode());
|
||||
|
||||
$response = json_decode($response->getBody(), true);
|
||||
|
||||
$this->assertStringContainsString('POTATO$', $response['data']['attributes']['contentHtml']);
|
||||
$this->assertEquals('@"POTATO$"#p4', $response['data']['attributes']['content']);
|
||||
$this->assertStringContainsString('PostMention', $response['data']['attributes']['contentHtml']);
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsPosts->find(4));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
|
|
@ -159,7 +159,7 @@ class UserMentionsTest extends TestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function mentioning_a_valid_user_with_new_format_with_smart_quotes_works()
|
||||
public function mentioning_a_valid_user_with_new_format_with_smart_quotes_works_and_falls_back_to_normal_quotes()
|
||||
{
|
||||
$response = $this->send(
|
||||
$this->request('POST', '/api/posts', [
|
||||
|
|
Loading…
Reference in New Issue
Block a user