mirror of
https://github.com/flarum/core.git
synced 2025-08-11 10:55:47 +02:00
chore: update dependencies (#4012)
* chore: phpunit 10 * chore: config * Apply fixes from StyleCI * chore: phpunit 11 (php 8.2 minimum requirement) * feat: laravel 11 * Apply fixes from StyleCI * feat: carbon v3 * fixes
This commit is contained in:
@@ -18,6 +18,7 @@ use Flarum\Testing\integration\RetrievesAuthorizedUsers;
|
||||
use Flarum\Testing\integration\TestCase;
|
||||
use Flarum\User\DisplayName\DriverInterface;
|
||||
use Flarum\User\User;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
|
||||
class UserMentionsTest extends TestCase
|
||||
{
|
||||
@@ -63,9 +64,7 @@ class UserMentionsTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function mentioning_a_valid_user_with_old_format_doesnt_work_if_off()
|
||||
{
|
||||
$this->setting('flarum-mentions.allow_username_format', '0');
|
||||
@@ -97,9 +96,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertCount(0, CommentPost::find($response['data']['id'])->mentionsUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function mentioning_a_valid_user_with_old_format_works_if_on()
|
||||
{
|
||||
$this->setting('flarum-mentions.allow_username_format', '1');
|
||||
@@ -131,9 +128,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function mentioning_a_valid_user_with_new_format_works()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -163,9 +158,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function mentioning_a_valid_user_with_new_format_with_smart_quotes_works_and_falls_back_to_normal_quotes()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -195,9 +188,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function mentioning_an_invalid_user_doesnt_work()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -227,9 +218,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertCount(0, CommentPost::find($response['data']['id'])->mentionsUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function mentioning_multiple_users_works()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -261,9 +250,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertCount(2, CommentPost::find($response['data']['id'])->mentionsUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function old_user_mentions_still_render()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -281,9 +268,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertCount(1, CommentPost::find($response['data']['id'])->mentionsUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function user_mentions_render_with_fresh_data()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -312,9 +297,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function user_mentions_unparse_with_fresh_data()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -342,9 +325,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function deleted_user_mentions_unparse_and_render_without_user_data()
|
||||
{
|
||||
$deleted_text = $this->app()->getContainer()->make('translator')->trans('core.lib.username.deleted_text');
|
||||
@@ -368,9 +349,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertCount(0, CommentPost::find($response['data']['id'])->mentionsUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function user_mentions_with_unremoved_bad_string_from_display_names_doesnt_work()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -400,9 +379,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function user_mentions_unparsing_removes_bad_display_name_string()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -421,9 +398,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function user_mentions_with_removed_bad_string_from_display_names_works()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -453,9 +428,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function editing_a_post_that_has_a_mention_works()
|
||||
{
|
||||
$response = $this->send(
|
||||
@@ -482,9 +455,7 @@ class UserMentionsTest extends TestCase
|
||||
$this->assertNotNull(CommentPost::find($response['data']['id'])->mentionsUsers->find(5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function editing_a_post_with_deleted_author_that_has_a_mention_works()
|
||||
{
|
||||
$response = $this->send(
|
||||
|
Reference in New Issue
Block a user