mirror of
https://github.com/flarum/core.git
synced 2025-08-14 04:14:06 +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:
@@ -14,8 +14,9 @@ use Flarum\Locale\TranslatorInterface;
|
||||
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
|
||||
use Flarum\Testing\integration\TestCase;
|
||||
use Flarum\User\User;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
|
||||
class UpdateTest extends TestCase
|
||||
class EditUserTest extends TestCase
|
||||
{
|
||||
use RetrievesAuthorizedUsers;
|
||||
|
||||
@@ -34,9 +35,7 @@ class UpdateTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function user_cant_edit_own_nickname_if_not_allowed()
|
||||
{
|
||||
$this->database()->table('group_permission')->where('permission', 'user.editOwnNickname')->where('group_id', Group::MEMBER_ID)->delete();
|
||||
@@ -58,9 +57,7 @@ class UpdateTest extends TestCase
|
||||
$this->assertEquals(403, $response->getStatusCode(), $response->getBody()->getContents());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function user_can_edit_own_nickname_if_allowed()
|
||||
{
|
||||
$this->prepareDatabase([
|
||||
@@ -88,9 +85,7 @@ class UpdateTest extends TestCase
|
||||
$this->assertEquals('new nickname', User::find(2)->nickname);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function cant_edit_nickname_if_invalid_regex()
|
||||
{
|
||||
$this->setting('flarum-nicknames.set_on_registration', true);
|
||||
|
@@ -12,6 +12,7 @@ namespace Flarum\Nicknames\Tests\integration;
|
||||
use Flarum\Extend;
|
||||
use Flarum\Testing\integration\TestCase;
|
||||
use Flarum\User\User;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
|
||||
class RegisterTest extends TestCase
|
||||
{
|
||||
@@ -26,9 +27,7 @@ class RegisterTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function can_register_with_nickname()
|
||||
{
|
||||
$this->setting('flarum-nicknames.set_on_registration', true);
|
||||
@@ -54,9 +53,7 @@ class RegisterTest extends TestCase
|
||||
$this->assertEquals('test@machine.local', $user->email);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function cant_register_with_nickname_if_not_allowed()
|
||||
{
|
||||
$this->setting('flarum-nicknames.set_on_registration', false);
|
||||
@@ -75,9 +72,7 @@ class RegisterTest extends TestCase
|
||||
$this->assertEquals(403, $response->getStatusCode(), $response->getBody()->getContents());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function cant_register_with_nickname_if_invalid_regex()
|
||||
{
|
||||
$this->setting('flarum-nicknames.set_on_registration', true);
|
||||
@@ -97,9 +92,7 @@ class RegisterTest extends TestCase
|
||||
$this->assertEquals(422, $response->getStatusCode(), $response->getBody()->getContents());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
#[Test]
|
||||
public function can_register_with_nickname_if_valid_regex()
|
||||
{
|
||||
$this->setting('flarum-nicknames.set_on_registration', true);
|
||||
|
Reference in New Issue
Block a user