1
0
mirror of https://github.com/flarum/core.git synced 2025-08-09 01:46:35 +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:
Sami Mazouz
2024-08-06 16:50:09 +01:00
committed by GitHub
parent 2f92a6c739
commit 6b336c5ea8
205 changed files with 1176 additions and 2361 deletions

View File

@@ -4,6 +4,7 @@ composer.phar
.DS_Store
Thumbs.db
tests/.phpunit.cache
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant

View File

@@ -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);

View File

@@ -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);

View File

@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="true"
stopOnFailure="false"
bootstrap="../../../php-packages/testing/bootstrap/monorepo.php"
>
<coverage processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
</source>
<testsuites>
<testsuite name="Flarum Integration Tests">
<directory suffix="Test.php">./integration</directory>

View File

@@ -1,28 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="../../../php-packages/testing/bootstrap/monorepo.php"
>
<coverage processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">../src/</directory>
</include>
</coverage>
</source>
<testsuites>
<testsuite name="Flarum Unit Tests">
<directory suffix="Test.php">./unit</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="\Mockery\Adapter\Phpunit\TestListener" />
</listeners>
</phpunit>