1
0
mirror of https://github.com/flarum/core.git synced 2025-08-11 02:44:04 +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

@@ -13,15 +13,14 @@ use Flarum\ExtensionManager\Tests\integration\ChangeComposerConfig;
use Flarum\ExtensionManager\Tests\integration\RefreshComposerSetup;
use Flarum\ExtensionManager\Tests\integration\TestCase;
use Illuminate\Support\Arr;
use PHPUnit\Framework\Attributes\Test;
class CheckForUpdatesTest extends TestCase
{
use RefreshComposerSetup;
use ChangeComposerConfig;
/**
* @test
*/
#[Test]
public function can_check_for_updates()
{
$this->setComposerConfig([

View File

@@ -11,14 +11,13 @@ namespace Flarum\ExtensionManager\Tests\integration\api;
use Flarum\ExtensionManager\Tests\integration\RefreshComposerSetup;
use Flarum\ExtensionManager\Tests\integration\TestCase;
use PHPUnit\Framework\Attributes\Test;
class GlobalUpdateTest extends TestCase
{
use RefreshComposerSetup;
/**
* @test
*/
#[Test]
public function can_global_update()
{
$response = $this->send(

View File

@@ -13,6 +13,7 @@ use Flarum\ExtensionManager\Tests\integration\ChangeComposerConfig;
use Flarum\ExtensionManager\Tests\integration\DummyExtensions;
use Flarum\ExtensionManager\Tests\integration\RefreshComposerSetup;
use Flarum\ExtensionManager\Tests\integration\TestCase;
use PHPUnit\Framework\Attributes\Test;
class MajorUpdateTest extends TestCase
{
@@ -20,9 +21,7 @@ class MajorUpdateTest extends TestCase
use ChangeComposerConfig;
use DummyExtensions;
/**
* @test
*/
#[Test]
public function cannot_update_when_no_update_check_ran()
{
$this->makeDummyExtensionCompatibleWith('flarum/dummy-incompatible-extension', '>=0.1.0-beta.15 <=0.1.0-beta.16');
@@ -45,9 +44,7 @@ class MajorUpdateTest extends TestCase
$this->assertEquals('no_new_major_version', $this->errorDetails($response)['code']);
}
/**
* @test
*/
#[Test]
public function can_update_when_major_update_available()
{
$this->makeDummyExtensionCompatibleWith('flarum/dummy-compatible-extension', '^0.1.0-beta.15 | ^1.0.0');
@@ -87,9 +84,7 @@ class MajorUpdateTest extends TestCase
$this->assertPackageVersion('flarum/dummy-compatible-extension', '*');
}
/**
* @test
*/
#[Test]
public function cannot_update_with_incompatible_extensions()
{
$this->makeDummyExtensionCompatibleWith('flarum/dummy-incompatible-extension-a', '>=0.1.0-beta.16 <0.1.0-beta.17');

View File

@@ -15,6 +15,7 @@ use Flarum\ExtensionManager\Tests\integration\ChangeComposerConfig;
use Flarum\ExtensionManager\Tests\integration\DummyExtensions;
use Flarum\ExtensionManager\Tests\integration\RefreshComposerSetup;
use Flarum\ExtensionManager\Tests\integration\TestCase;
use PHPUnit\Framework\Attributes\Test;
class MinorUpdateTest extends TestCase
{
@@ -22,9 +23,7 @@ class MinorUpdateTest extends TestCase
use ChangeComposerConfig;
use DummyExtensions;
/**
* @test
*/
#[Test]
public function can_update_to_next_minor_version()
{
$this->makeDummyExtensionCompatibleWith('flarum/dummy-compatible-extension', '^1.0.0');
@@ -53,9 +52,7 @@ class MinorUpdateTest extends TestCase
$this->assertPackageVersion('flarum/dummy-compatible-extension', '*');
}
/**
* @test
*/
#[Test]
public function can_update_with_latest_ext_incompatible_with_latest_core()
{
$this->makeDummyExtensionCompatibleWith('flarum/dummy-extension', '1.0.0');

View File

@@ -11,22 +11,19 @@ namespace Flarum\ExtensionManager\Tests\integration\api\extensions;
use Flarum\ExtensionManager\Tests\integration\RefreshComposerSetup;
use Flarum\ExtensionManager\Tests\integration\TestCase;
use PHPUnit\Framework\Attributes\Test;
class RemoveExtensionTest extends TestCase
{
use RefreshComposerSetup;
/**
* @test
*/
#[Test]
public function extension_installed_by_default()
{
$this->assertExtensionExists('flarum-tags');
}
/**
* @test
*/
#[Test]
public function removing_an_extension_works()
{
$response = $this->send(
@@ -39,9 +36,7 @@ class RemoveExtensionTest extends TestCase
$this->assertExtensionNotExists('flarum-tags');
}
/**
* @test
*/
#[Test]
public function removing_a_non_existant_extension_fails()
{
$response = $this->send(

View File

@@ -11,22 +11,19 @@ namespace Flarum\ExtensionManager\Tests\integration\api\extensions;
use Flarum\ExtensionManager\Tests\integration\RefreshComposerSetup;
use Flarum\ExtensionManager\Tests\integration\TestCase;
use PHPUnit\Framework\Attributes\Test;
class RequireExtensionTest extends TestCase
{
use RefreshComposerSetup;
/**
* @test
*/
#[Test]
public function extension_uninstalled_by_default()
{
$this->assertExtensionNotExists('v17development-blog');
}
/**
* @test
*/
#[Test]
public function requiring_an_existing_extension_fails()
{
$response = $this->send(
@@ -43,9 +40,7 @@ class RequireExtensionTest extends TestCase
$this->assertEquals(409, $response->getStatusCode());
}
/**
* @test
*/
#[Test]
public function requiring_a_compatible_extension_works()
{
$response = $this->send(
@@ -63,9 +58,7 @@ class RequireExtensionTest extends TestCase
$this->assertExtensionExists('v17development-blog');
}
/**
* @test
*/
#[Test]
public function requiring_a_compatible_extension_with_specific_version_works()
{
$response = $this->send(
@@ -83,9 +76,7 @@ class RequireExtensionTest extends TestCase
$this->assertExtensionExists('v17development-blog');
}
/**
* @test
*/
#[Test]
public function requiring_an_uncompatible_extension_fails()
{
$response = $this->send(
@@ -103,9 +94,7 @@ class RequireExtensionTest extends TestCase
$this->assertEquals('extension_incompatible_with_instance', $this->errorDetails($response)['guessed_cause']);
}
/**
* @test
*/
#[Test]
public function requiring_an_uncompatible_extension_with_specific_version_fails()
{
$response = $this->send(

View File

@@ -11,22 +11,19 @@ namespace Flarum\ExtensionManager\Tests\integration\api\extensions;
use Flarum\ExtensionManager\Tests\integration\RefreshComposerSetup;
use Flarum\ExtensionManager\Tests\integration\TestCase;
use PHPUnit\Framework\Attributes\Test;
class UpdateExtensionTest extends TestCase
{
use RefreshComposerSetup;
/**
* @test
*/
#[Test]
public function extension_installed_by_default()
{
$this->assertExtensionExists('flarum-tags');
}
/**
* @test
*/
#[Test]
public function updating_an_existing_extension_works()
{
$response = $this->send(
@@ -39,9 +36,7 @@ class UpdateExtensionTest extends TestCase
$this->assertExtensionExists('flarum-tags');
}
/**
* @test
*/
#[Test]
public function updating_a_non_existing_extension_fails()
{
$response = $this->send(

View File

@@ -1,21 +1,19 @@
<?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"
>
<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,27 +1,22 @@
<?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"
>
<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>