mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
chore: Upgrade dependencies (#3830)
* wip: laraval and symfony upgrades * Apply fixes from StyleCI * Apply fixes from StyleCI * bump var dumper to 6.3 * require guzzle 7.7 * remove docbloc * lock symfony/translation-contracts to 2.5 * fix: require mailgun package * remove docblock * fix: flysystem tests * fix: instance flarum assets for testing * Apply fixes from StyleCI * downgrade intervention/image back to 2.x * Apply fixes from StyleCI * provide ImageManager to AvatarUploader * fix larastan * revert back some other intervention/image changes * fix image resize * Update framework/core/src/Http/Middleware/AuthenticateWithHeader.php Co-authored-by: Daniël Klabbers <luceos@users.noreply.github.com> * Apply fixes from StyleCI * Update framework/core/src/Mail/SmtpDriver.php Co-authored-by: Sami Mazouz <sychocouldy@gmail.com> * Update framework/core/src/User/LoginProvider.php Co-authored-by: Sami Mazouz <sychocouldy@gmail.com> * use named attrs * revert imagemanager in constructor * revert to using Contract mailer * reinstate and update FlarumLogTransport * correct var typo, use one less temp var * names attrs * uncomment test * mailer contract * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <bot@styleci.io> Co-authored-by: Daniël Klabbers <luceos@users.noreply.github.com> Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
@@ -113,7 +113,7 @@ class AccessTokenLifecycleTest extends TestCase
|
||||
|
||||
/** @var AccessToken $token */
|
||||
$token = AccessToken::whereToken('a')->firstOrFail();
|
||||
$token->touch((new ServerRequest([
|
||||
$token->touch(request: (new ServerRequest([
|
||||
'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36',
|
||||
]))->withAttribute('ipAddress', '8.8.8.8'));
|
||||
|
||||
@@ -132,7 +132,7 @@ class AccessTokenLifecycleTest extends TestCase
|
||||
|
||||
/** @var AccessToken $token */
|
||||
$token = AccessToken::whereToken('a')->firstOrFail();
|
||||
$token->touch(new ServerRequest([
|
||||
$token->touch(request: new ServerRequest([
|
||||
'HTTP_USER_AGENT' => str_repeat('a', 500),
|
||||
]));
|
||||
|
||||
|
@@ -258,7 +258,7 @@ class CreateTest extends TestCase
|
||||
'username' => 'test',
|
||||
'email' => 'test@machine.local',
|
||||
'is_email_confirmed' => 1,
|
||||
'avatar_url' => 'https://192.168.0.1/image.png'
|
||||
'avatar_url' => 'https://i_do_not_exist.flarum.org/image.png'
|
||||
], []);
|
||||
|
||||
$regTokens[] = RegistrationToken::generate('flarum', '1', [
|
||||
|
@@ -20,9 +20,8 @@ use Flarum\Testing\integration\TestCase;
|
||||
use Illuminate\Contracts\Filesystem\Cloud;
|
||||
use Illuminate\Filesystem\FilesystemAdapter;
|
||||
use InvalidArgumentException;
|
||||
use League\Flysystem\Adapter\Local;
|
||||
use League\Flysystem\Adapter\NullAdapter;
|
||||
use League\Flysystem\Filesystem as LeagueFilesystem;
|
||||
use League\Flysystem\InMemory\InMemoryFilesystemAdapter;
|
||||
use League\Flysystem\Local\LocalFilesystemAdapter;
|
||||
|
||||
class FilesystemTest extends TestCase
|
||||
{
|
||||
@@ -49,9 +48,10 @@ class FilesystemTest extends TestCase
|
||||
];
|
||||
}));
|
||||
|
||||
/** @var FilesystemAdapter $uploadsDisk */
|
||||
$uploadsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-uploads');
|
||||
|
||||
$this->assertEquals(get_class($uploadsDisk->getDriver()->getAdapter()), Local::class);
|
||||
$this->assertEquals(get_class($uploadsDisk->getAdapter()), LocalFilesystemAdapter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,9 +61,10 @@ class FilesystemTest extends TestCase
|
||||
{
|
||||
$this->extend((new Extend\Filesystem)->disk('flarum-uploads', UploadsDisk::class));
|
||||
|
||||
/** @var FilesystemAdapter $uploadsDisk */
|
||||
$uploadsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-uploads');
|
||||
|
||||
$this->assertEquals(get_class($uploadsDisk->getDriver()->getAdapter()), Local::class);
|
||||
$this->assertEquals(get_class($uploadsDisk->getAdapter()), LocalFilesystemAdapter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,9 +74,10 @@ class FilesystemTest extends TestCase
|
||||
{
|
||||
$this->app()->getContainer()->make(SettingsRepositoryInterface::class)->set('disk_driver.flarum-assets', 'nonexistent_driver');
|
||||
|
||||
/** @var FilesystemAdapter $assetsDisk */
|
||||
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
|
||||
|
||||
$this->assertEquals(get_class($assetsDisk->getDriver()->getAdapter()), Local::class);
|
||||
$this->assertEquals(get_class($assetsDisk->getAdapter()), LocalFilesystemAdapter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,9 +87,10 @@ class FilesystemTest extends TestCase
|
||||
{
|
||||
$this->config('disk_driver.flarum-assets', 'null');
|
||||
|
||||
/** @var FilesystemAdapter $assetsDisk */
|
||||
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
|
||||
|
||||
$this->assertEquals(get_class($assetsDisk->getDriver()->getAdapter()), Local::class);
|
||||
$this->assertEquals(get_class($assetsDisk->getAdapter()), LocalFilesystemAdapter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,9 +104,10 @@ class FilesystemTest extends TestCase
|
||||
|
||||
$this->app()->getContainer()->make(SettingsRepositoryInterface::class)->set('disk_driver.flarum-assets', 'null');
|
||||
|
||||
/** @var FilesystemAdapter $assetsDisk */
|
||||
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
|
||||
|
||||
$this->assertEquals(get_class($assetsDisk->getDriver()->getAdapter()), NullAdapter::class);
|
||||
$this->assertEquals(get_class($assetsDisk->getAdapter()), InMemoryFilesystemAdapter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,9 +121,10 @@ class FilesystemTest extends TestCase
|
||||
|
||||
$this->config('disk_driver.flarum-assets', 'null');
|
||||
|
||||
/** @var FilesystemAdapter $assetsDisk */
|
||||
$assetsDisk = $this->app()->getContainer()->make('filesystem')->disk('flarum-assets');
|
||||
|
||||
$this->assertEquals(get_class($assetsDisk->getDriver()->getAdapter()), NullAdapter::class);
|
||||
$this->assertEquals(get_class($assetsDisk->getAdapter()), InMemoryFilesystemAdapter::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +132,13 @@ class NullFilesystemDriver implements DriverInterface
|
||||
{
|
||||
public function build(string $diskName, SettingsRepositoryInterface $settings, Config $config, array $localConfig): Cloud
|
||||
{
|
||||
return new FilesystemAdapter(new LeagueFilesystem(new NullAdapter()));
|
||||
// The internal adapter
|
||||
$adapter = new InMemoryFilesystemAdapter();
|
||||
|
||||
// The FilesystemOperator
|
||||
$filesystem = new \League\Flysystem\Filesystem($adapter);
|
||||
|
||||
return new FilesystemAdapter($filesystem, $adapter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -16,8 +16,8 @@ use Flarum\Testing\integration\RetrievesAuthorizedUsers;
|
||||
use Flarum\Testing\integration\TestCase;
|
||||
use Illuminate\Contracts\Validation\Factory;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Swift_NullTransport;
|
||||
use Swift_Transport;
|
||||
use Symfony\Component\Mailer\Transport\NullTransport;
|
||||
use Symfony\Component\Mailer\Transport\TransportInterface;
|
||||
|
||||
class MailTest extends TestCase
|
||||
{
|
||||
@@ -110,8 +110,8 @@ class CustomDriver implements DriverInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
public function buildTransport(SettingsRepositoryInterface $settings): Swift_Transport
|
||||
public function buildTransport(SettingsRepositoryInterface $settings): TransportInterface
|
||||
{
|
||||
return new Swift_NullTransport;
|
||||
return new NullTransport();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user