From 0f714f854016a4a2a839f2c4f79db92542dc2860 Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Tue, 4 Nov 2025 23:49:42 +0100 Subject: [PATCH] test: upgrade to PHPUnit 11 Signed-off-by: Anna Larch --- composer.json | 2 +- lib/AppInfo/Application.php | 16 +- lib/Controller/FeedController.php | 14 +- lib/Listener/SetUserDefaults.php | 15 +- lib/MailQueueHandler.php | 4 +- tests/AppInfo/ApplicationTest.php | 19 +- tests/BackgroundJob/EmailNotificationTest.php | 12 +- tests/BackgroundJob/ExpireActivitiesTest.php | 4 +- tests/ConsumerTest.php | 86 +- tests/Controller/APIv1ControllerTest.php | 58 +- tests/Controller/APIv2ControllerTest.php | 259 ++----- tests/Controller/ActivitiesControllerTest.php | 41 +- tests/Controller/FeedControllerTest.php | 84 +- tests/CurrentUserTest.php | 88 +-- tests/DataDeleteActivitiesTest.php | 24 +- tests/DataTest.php | 95 +-- tests/FilesHooksTest.php | 124 +-- tests/GroupHelperTest.php | 42 +- tests/Listener/SetUserDefaultsTest.php | 67 +- tests/Listener/UserDeletedTest.php | 43 +- tests/MailQueueHandlerTest.php | 133 ++-- tests/Mock/Setting1.php | 47 +- tests/Mock/Setting2.php | 47 +- tests/Template/RssTest.php | 21 +- tests/UserSettingsTest.php | 21 +- tests/ViewInfoCacheTest.php | 55 +- tests/phpunit.xml | 42 +- vendor-bin/cs-fixer/composer.json | 4 +- vendor-bin/cs-fixer/composer.lock | 38 +- vendor-bin/phpunit/composer.json | 6 +- vendor-bin/phpunit/composer.lock | 733 +++++++++--------- vendor-bin/psalm/composer.json | 4 +- vendor-bin/psalm/composer.lock | 292 +++---- 33 files changed, 1050 insertions(+), 1490 deletions(-) diff --git a/composer.json b/composer.json index fccc140c4..39fedf723 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "optimize-autoloader": true, "classmap-authoritative": true, "platform": { - "php": "8.3" + "php": "8.2" }, "sort-packages": true, "allow-plugins": { diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 1561a5957..93216a662 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -35,7 +35,9 @@ use OCP\IURLGenerator; use OCP\IUserManager; use OCP\L10N\IFactory; +use OCP\Mail\IEmailValidator; use OCP\Mail\IMailer; +use OCP\Notification\IManager as INotificationManager; use OCP\RichObjectStrings\IValidator; use OCP\Share\Events\BeforeShareDeletedEvent; use OCP\Share\Events\ShareCreatedEvent; @@ -118,6 +120,7 @@ public function register(IRegistrationContext $context): void { $c->get(Data::class), $c->get(GroupHelper::class), $c->get(UserSettings::class), + $c->get(IEmailValidator::class), ); }); @@ -144,25 +147,24 @@ public function boot(IBootContext $context): void { /** * Registers the consumer to the Activity Manager */ - private function registerActivityConsumer() { + private function registerActivityConsumer(): void { $c = $this->getContainer(); - /** @var \OCP\IServerContainer $server */ $server = $c->getServer(); - $server->getActivityManager()->registerConsumer(function () use ($c) { - return $c->query(Consumer::class); + $server->get(IManager::class)->registerConsumer(function () use ($c) { + return $c->get(Consumer::class); }); } - public function registerNotifier() { + public function registerNotifier(): void { $server = $this->getContainer()->getServer(); - $server->getNotificationManager()->registerNotifierService(NotificationGenerator::class); + $server->get(INotificationManager::class)->registerNotifierService(NotificationGenerator::class); } /** * Register the hooks for filesystem operations */ - private function registerFilesActivity(IRegistrationContext $context) { + private function registerFilesActivity(IRegistrationContext $context): void { // All other events from other apps have to be send via the Consumer Util::connectHook('OC_Filesystem', 'post_create', FilesHooksStatic::class, 'fileCreate'); Util::connectHook('OC_Filesystem', 'post_update', FilesHooksStatic::class, 'fileUpdate'); diff --git a/lib/Controller/FeedController.php b/lib/Controller/FeedController.php index 85253b0f1..176d6e695 100644 --- a/lib/Controller/FeedController.php +++ b/lib/Controller/FeedController.php @@ -13,6 +13,8 @@ use OCA\Theming\ThemingDefaults; use OCP\Activity\IManager; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\Attribute\NoCSRFRequired; +use OCP\AppFramework\Http\Attribute\PublicPage; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\IL10N; @@ -40,13 +42,9 @@ public function __construct( parent::__construct($appName, $request); } - /** - * @PublicPage - * @NoCSRFRequired - * - * @return TemplateResponse - */ - public function show() { + #[PublicPage] + #[NoCSRFRequired] + public function show(): TemplateResponse { try { $user = $this->activityManager->getCurrentUserId(); @@ -83,7 +81,7 @@ public function show() { 'activities' => $activities, ], ''); - if (stristr($this->request->getHeader('accept'), 'application/rss+xml')) { + if (stripos($this->request->getHeader('accept'), 'application/rss+xml') !== false) { $response->addHeader('Content-Type', 'application/rss+xml'); } else { $response->addHeader('Content-Type', 'text/xml; charset=UTF-8'); diff --git a/lib/Listener/SetUserDefaults.php b/lib/Listener/SetUserDefaults.php index cae31514d..7bc7b7caf 100644 --- a/lib/Listener/SetUserDefaults.php +++ b/lib/Listener/SetUserDefaults.php @@ -10,6 +10,7 @@ use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; +use OCP\IAppConfig; use OCP\IConfig; use OCP\IUser; use OCP\User\Events\PostLoginEvent; @@ -18,11 +19,11 @@ * @template-implements IEventListener */ class SetUserDefaults implements IEventListener { - /** @var IConfig */ - private $config; - public function __construct(IConfig $config) { - $this->config = $config; + public function __construct( + private IConfig $config, + private IAppConfig $appConfig, + ) { } #[\Override] @@ -41,8 +42,8 @@ private function setDefaultsForUser(IUser $user): void { return; } - foreach ($this->config->getAppKeys('activity') as $key) { - if (strpos($key, 'notify_') !== 0) { + foreach ($this->appConfig->getKeys('activity') as $key) { + if (!str_starts_with($key, 'notify_')) { continue; } @@ -55,7 +56,7 @@ private function setDefaultsForUser(IUser $user): void { $user->getUID(), 'activity', $key, - $this->config->getAppValue('activity', $key) + $this->appConfig->getValueString('activity', $key) ); } diff --git a/lib/MailQueueHandler.php b/lib/MailQueueHandler.php index 4320329db..39ae89d9f 100644 --- a/lib/MailQueueHandler.php +++ b/lib/MailQueueHandler.php @@ -20,6 +20,7 @@ use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Mail\Headers\AutoSubmitted; +use OCP\Mail\IEmailValidator; use OCP\Mail\IMailer; use OCP\RichObjectStrings\IValidator; use OCP\Util; @@ -55,6 +56,7 @@ public function __construct( protected Data $data, protected GroupHelper $groupHelper, protected UserSettings $userSettings, + protected IEmailValidator $emailValidator, ) { } @@ -271,7 +273,7 @@ protected function sendEmailToUser(string $userName, string $email, string $lang return true; } - if (!$this->mailer->validateMailAddress($email)) { + if (!$this->emailValidator->isValid($email)) { $this->logger->warning('Notification for user "{user}" not sent because the email address "{email}" is invalid.', ['user' => $userName, 'email' => $email]); return true; } diff --git a/tests/AppInfo/ApplicationTest.php b/tests/AppInfo/ApplicationTest.php index 0a9212815..f824b52b5 100644 --- a/tests/AppInfo/ApplicationTest.php +++ b/tests/AppInfo/ApplicationTest.php @@ -47,11 +47,12 @@ use OCA\Activity\ViewInfoCache; use OCP\Activity\IConsumer; use OCP\AppFramework\Controller; -use OCP\AppFramework\IAppContainer; use OCP\AppFramework\OCSController; use OCP\BackgroundJob\TimedJob; use OCP\Capabilities\ICapability; use OCP\IL10N; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; /** * Class ApplicationTest @@ -59,11 +60,9 @@ * @group DB * @package OCA\Activity\Tests\AppInfo */ +#[Group('DB')] class ApplicationTest extends TestCase { - /** @var Application */ - protected $app; - - /** @var IAppContainer */ + protected Application $app; protected $container; protected function setUp(): void { @@ -74,10 +73,10 @@ protected function setUp(): void { public function testContainerAppName(): void { $this->app = new Application(); - $this->assertEquals('activity', $this->container->getAppName()); + $this->assertEquals($this->app::APP_ID, $this->container->getAppName()); } - public function queryData(): array { + public static function queryData(): array { return [ [IL10N::class], [View::class], @@ -119,11 +118,7 @@ public function queryData(): array { ]; } - /** - * @dataProvider queryData - * @param string $service - * @param string $expected - */ + #[DataProvider('queryData')] public function testContainerQuery(string $service, ?string $expected = null): void { if ($expected === null) { $expected = $service; diff --git a/tests/BackgroundJob/EmailNotificationTest.php b/tests/BackgroundJob/EmailNotificationTest.php index 24de7beed..b9f6a48ed 100644 --- a/tests/BackgroundJob/EmailNotificationTest.php +++ b/tests/BackgroundJob/EmailNotificationTest.php @@ -29,25 +29,23 @@ use OCA\Activity\Tests\TestCase; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; /** * Class EmailNotificationTest - * - * @group DB * @package OCA\Activity\Tests\BackgroundJob */ +#[Group('DB')] class EmailNotificationTest extends TestCase { - public function constructAndRunData(): array { + public static function constructAndRunData(): array { return [ [true], [false], ]; } - /** - * @dataProvider constructAndRunData - * @param bool $isCLI - */ + #[DataProvider('constructAndRunData')] public function testConstructAndRun(bool $isCLI): void { $backgroundJob = new EmailNotification( $this->createMock(ITimeFactory::class), diff --git a/tests/BackgroundJob/ExpireActivitiesTest.php b/tests/BackgroundJob/ExpireActivitiesTest.php index 0dcadfcc4..e8c95fca9 100644 --- a/tests/BackgroundJob/ExpireActivitiesTest.php +++ b/tests/BackgroundJob/ExpireActivitiesTest.php @@ -31,13 +31,13 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\IConfig; +use PHPUnit\Framework\Attributes\Group; /** * Class ExpireActivitiesTest - * - * @group DB * @package OCA\Activity\Tests\BackgroundJob */ +#[Group('DB')] class ExpireActivitiesTest extends TestCase { public function testExecute(): void { $backgroundJob = new ExpireActivities( diff --git a/tests/ConsumerTest.php b/tests/ConsumerTest.php index 627a166ef..d77849ca7 100644 --- a/tests/ConsumerTest.php +++ b/tests/ConsumerTest.php @@ -29,33 +29,25 @@ use OCA\Activity\NotificationGenerator; use OCA\Activity\UserSettings; use OCP\Activity\IManager; +use OCP\IDBConnection; use OCP\IL10N; use OCP\L10N\IFactory; +use OCP\Server; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\MockObject\MockObject; /** * Class ConsumerTest - * - * @group DB * @package OCA\Activity\Tests */ +#[Group('DB')] class ConsumerTest extends TestCase { - /** @var Consumer */ - protected $consumer; - - /** @var Data|MockObject */ - protected $data; - - /** @var IFactory|MockObject */ - protected $l10nFactory; - /** @var IManager|MockObject */ - protected $activityManager; - - /** @var \OCA\Activity\UserSettings */ - protected $userSettings; - - /** @var NotificationGenerator|MockObject */ - protected $notificationGenerator; + protected Data&MockObject $data; + protected MockObject&IFactory $l10nFactory; + protected IManager&MockObject $activityManager; + protected NotificationGenerator&MockObject $notificationGenerator; + protected UserSettings $userSettings; protected function setUp(): void { parent::setUp(); @@ -63,25 +55,21 @@ protected function setUp(): void { $this->activityManager = $this->createMock(IManager::class); $this->data = $this->createMock(Data::class); - $this->data->method('send') - ->willReturn(1); - $this->userSettings = $this->getMockBuilder(UserSettings::class) ->onlyMethods(['getUserSetting']) ->disableOriginalConstructor() ->getMock(); - $l10n = $this->createMock(IL10N::class); - $this->notificationGenerator = $this->createMock(NotificationGenerator::class); - $this->l10nFactory = $this->createMock(IFactory::class); - $this->l10nFactory->expects($this->any()) + + $this->data->method('send') + ->willReturn(1); + $this->l10nFactory ->method('get') ->with('activity') ->willReturn($l10n); - - $this->userSettings->expects($this->any()) + $this->userSettings ->method('getUserSetting') ->with($this->stringContains('affectedUser'), $this->anything(), $this->anything()) ->willReturnMap([ @@ -100,14 +88,14 @@ protected function tearDown(): void { } protected function deleteTestActivities(): void { - $query = \OC::$server->getDatabaseConnection()->getQueryBuilder(); + $query = Server::get(IDBConnection::class)->getQueryBuilder(); $query->delete('activity') ->where($query->expr()->eq( 'app', $query->createNamedParameter('test') )); $query->executeStatement(); - $query = \OC::$server->getDatabaseConnection()->getQueryBuilder(); + $query = Server::get(IDBConnection::class)->getQueryBuilder(); $query->delete('activity_mq') ->where($query->expr()->eq( 'amq_appid', $query->createNamedParameter('test') @@ -115,16 +103,14 @@ protected function deleteTestActivities(): void { $query->executeStatement(); } - public function receiveData(): array { + public static function receiveData(): array { return [ ['type', 'author', 'affectedUser', 'subject', 'affectedUser'], ['type2', 'author', 'affectedUser', 'subject', false], - ['type', 'author', 'affectedUser', 'subject_self', 'affectedUser'], ['type', 'author', 'affectedUser2', 'subject_self', 'affectedUser2'], ['type', 'author', 'affectedUser', 'subject2', 'affectedUser'], ['type', 'author', 'affectedUser2', 'subject2', 'affectedUser2'], - ['type', 'affectedUser', 'affectedUser', 'subject_self', 'affectedUser'], ['type', 'affectedUser2', 'affectedUser2', 'subject_self', false], ['type', 'affectedUser', 'affectedUser', 'subject2', 'affectedUser'], @@ -132,18 +118,10 @@ public function receiveData(): array { ]; } - /** - * @dataProvider receiveData - * - * @param string $type - * @param string $author - * @param string $affectedUser - * @param string $subject - * @param array|false $expected - */ + #[DataProvider('receiveData')] public function testReceiveStream(string $type, string $author, string $affectedUser, string $subject): void { $consumer = new Consumer($this->data, $this->activityManager, $this->userSettings, $this->notificationGenerator); - $event = \OC::$server->getActivityManager()->generateEvent(); + $event = Server::get(IManager::class)->generateEvent(); $event->setApp('test') ->setType($type) ->setAffectedUser($affectedUser) @@ -161,19 +139,11 @@ public function testReceiveStream(string $type, string $author, string $affected $consumer->receive($event); } - /** - * @dataProvider receiveData - * - * @param string $type - * @param string $author - * @param string $affectedUser - * @param string $subject - * @param array|false $expected - */ + #[DataProvider('receiveData')] public function testReceiveEmail(string $type, string $author, string $affectedUser, string $subject, $expected): void { $time = time(); $consumer = new Consumer($this->data, $this->activityManager, $this->userSettings, $this->notificationGenerator); - $event = \OC::$server->getActivityManager()->generateEvent(); + $event = Server::get(IManager::class)->generateEvent(); $event->setApp('test') ->setType($type) ->setAffectedUser($affectedUser) @@ -196,18 +166,10 @@ public function testReceiveEmail(string $type, string $author, string $affectedU $consumer->receive($event); } - /** - * @dataProvider receiveData - * - * @param string $type - * @param string $author - * @param string $affectedUser - * @param string $subject - * @param array|false $expected - */ + #[DataProvider('receiveData')] public function testReceiveNotification(string $type, string $author, string $affectedUser, string $subject, $expected): void { $consumer = new Consumer($this->data, $this->activityManager, $this->userSettings, $this->notificationGenerator); - $event = \OC::$server->getActivityManager()->generateEvent(); + $event = Server::get(IManager::class)->generateEvent(); $event->setApp('test') ->setType($type) ->setAffectedUser($affectedUser) diff --git a/tests/Controller/APIv1ControllerTest.php b/tests/Controller/APIv1ControllerTest.php index 106be2f8c..53ea144e9 100644 --- a/tests/Controller/APIv1ControllerTest.php +++ b/tests/Controller/APIv1ControllerTest.php @@ -24,6 +24,7 @@ namespace OCA\Activity\Tests\Controller; use OC\Activity\Manager; +use OCA\Activity\AppInfo\Application; use OCA\Activity\Controller\APIv1Controller; use OCA\Activity\CurrentUser; use OCA\Activity\Data; @@ -37,20 +38,25 @@ use OCP\Activity\IManager; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; +use OCP\IDBConnection; use OCP\IL10N; use OCP\IRequest; +use OCP\IUserManager; use OCP\IUserSession; +use OCP\RichObjectStrings\IRichTextFormatter; use OCP\RichObjectStrings\IValidator; +use OCP\Server; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use Psr\Log\LoggerInterface; /** * Class APIv1Test - * - * @group DB * @package OCA\Activity\Tests\Controller */ +#[Group('DB')] class APIv1ControllerTest extends TestCase { - protected $originalWEBROOT; + protected string $originalWEBROOT; protected function setUp(): void { parent::setUp(); @@ -58,8 +64,9 @@ protected function setUp(): void { $this->originalWEBROOT = \OC::$WEBROOT; \OC::$WEBROOT = ''; - \OC::$server->getUserManager()->createUser('activity-api-user1', 'activity-api-user1'); - \OC::$server->getUserManager()->createUser('activity-api-user2', 'activity-api-user2'); + $manager = Server::get(IUserManager::class); + $manager->createUser('activity-api-user1', 'activity-api-user1'); + $manager->createUser('activity-api-user2', 'activity-api-user2'); $activities = [ [ @@ -76,7 +83,7 @@ protected function setUp(): void { ], ]; - $queryActivity = \OC::$server->getDatabaseConnection()->prepare('INSERT INTO `*PREFIX*activity`(`app`, `subject`, `subjectparams`, `message`, `messageparams`, `file`, `link`, `user`, `affecteduser`, `timestamp`, `priority`, `type`)' . ' VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'); + $queryActivity = Server::get(IDBConnection::class)->prepare('INSERT INTO `*PREFIX*activity`(`app`, `subject`, `subjectparams`, `message`, `messageparams`, `file`, `link`, `user`, `affecteduser`, `timestamp`, `priority`, `type`)' . ' VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'); $loop = 0; foreach ($activities as $activity) { $queryActivity->execute([ @@ -107,7 +114,7 @@ protected function tearDown(): void { protected function cleanUp(): void { $data = new Data( $this->createMock(IManager::class), - \OC::$server->getDatabaseConnection(), + Server::get(IDBConnection::class), $this->createMock(LoggerInterface::class), $this->createMock(IConfig::class), ); @@ -124,13 +131,11 @@ protected function deleteUser(Data $data, string $uid): void { $data->deleteActivities([ 'affecteduser' => $uid, ]); - $user = \OC::$server->getUserManager()->get($uid); - if ($user) { - $user->delete(); - } + $user = Server::get(IUserManager::class)->get($uid); + $user?->delete(); } - public function getData(): array { + public static function getData(): array { return [ ['activity-api-user2', 0, 30, []], ['activity-api-user1', 0, 30, [ @@ -184,33 +189,26 @@ public function getData(): array { ]; } - /** - * @dataProvider getData - * - * @param string $user - * @param int $start - * @param int $count - * @param array $expected - */ + #[DataProvider('getData')] public function testGet(string $user, int $start, int $count, array $expected): void { $config = $this->createMock(IConfig::class); - $config->expects($this->any()) + $config ->method('getUserValue') ->willReturnArgument(3); $l = $this->createMock(IL10N::class); - $l->expects($this->any()) + $l ->method('t') - ->will($this->returnCallback(function ($text, $parameters = []) { + ->willReturnCallback(function ($text, $parameters = []) { return vsprintf($text, $parameters); - })); + }); $activityManager = new Manager( $this->createMock(IRequest::class), $this->createMock(IUserSession::class), $config, - \OC::$server->query(IValidator::class), - \OC::$server->query(\OCP\RichObjectStrings\IRichTextFormatter::class), + Server::get(IValidator::class), + Server::get(IRichTextFormatter::class), $this->createMock(IL10N::class), $this->createMock(ITimeFactory::class), ); @@ -221,24 +219,24 @@ public function testGet(string $user, int $start, int $count, array $expected): $currentUser = $this->getMockBuilder(CurrentUser::class) ->disableOriginalConstructor() ->getMock(); - $currentUser->expects($this->any()) + $currentUser ->method('getUID') ->willReturn($user); $data = new Data($activityManager, - \OC::$server->getDatabaseConnection(), + Server::get(IDBConnection::class), $this->createMock(LoggerInterface::class), $this->createMock(IConfig::class), ); $controller = new APIv1Controller( - 'activity', + Application::APP_ID, $this->createMock(IRequest::class), $data, new GroupHelper($l, $activityManager, $this->createMock(IValidator::class), $this->createMock(LoggerInterface::class)), new UserSettings($activityManager, $config), $currentUser, - \OC::$server->getDatabaseConnection(), + Server::get(IDBConnection::class), ); $response = $controller->get($start, $count); diff --git a/tests/Controller/APIv2ControllerTest.php b/tests/Controller/APIv2ControllerTest.php index a9830d66c..07f75f911 100644 --- a/tests/Controller/APIv2ControllerTest.php +++ b/tests/Controller/APIv2ControllerTest.php @@ -24,6 +24,7 @@ namespace OCA\Activity\Tests\Controller; +use DateTimeInterface; use OCA\Activity\Controller\APIv2Controller; use OCA\Activity\Data; use OCA\Activity\Exception\InvalidFilterException; @@ -42,50 +43,28 @@ use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserSession; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\MockObject\MockObject; /** * Class APIv2Test - * - * @group DB * @package OCA\Activity\Tests\Controller */ +#[Group('DB')] class APIv2ControllerTest extends TestCase { - /** @var IRequest|MockObject */ - protected $request; - - /** @var IManager|MockObject */ - protected $activityManager; - - /** @var Data|MockObject */ - protected $data; - - /** @var GroupHelper|MockObject */ - protected $helper; - - /** @var UserSettings|MockObject */ - protected $userSettings; - - /** @var IPreview|MockObject */ - protected $preview; - - /** @var IURLGenerator|MockObject */ - protected $urlGenerator; - - /** @var IUserSession|MockObject */ - protected $userSession; - - /** @var IMimeTypeDetector|MockObject */ - protected $mimeTypeDetector; - - /** @var ViewInfoCache|MockObject */ - protected $infoCache; - - /** @var IL10N */ - protected $l10n; - - /** @var APIv2Controller */ - protected $controller; + protected MockObject&IRequest $request; + protected IManager&MockObject $activityManager; + protected Data&MockObject $data; + protected GroupHelper&MockObject $helper; + protected UserSettings&MockObject $userSettings; + protected IPreview&MockObject $preview; + protected MockObject&IURLGenerator $urlGenerator; + protected IUserSession&MockObject $userSession; + protected IMimeTypeDetector&MockObject $mimeTypeDetector; + protected ViewInfoCache&MockObject $infoCache; + protected IL10N $l10n; + protected APIv2Controller $controller; protected function setUp(): void { parent::setUp(); @@ -104,11 +83,7 @@ protected function setUp(): void { $this->controller = $this->getController(); } - protected function tearDown(): void { - parent::tearDown(); - } - - protected function getController(array $methods = []): APIv2Controller { + protected function getController(array $methods = []): APIv2Controller|MockObject { if (empty($methods)) { return new APIv2Controller( 'activity', @@ -143,18 +118,14 @@ protected function getController(array $methods = []): APIv2Controller { ->getMock(); } - public function dataValidateParametersFilter(): array { + public static function dataValidateParametersFilter(): array { return [ ['valid1', 'valid1'], ['all', 'all'], ]; } - /** - * @dataProvider dataValidateParametersFilter - * @param string $param - * @param string $filter - */ + #[DataProvider('dataValidateParametersFilter')] public function testValidateParametersFilter(string $param, string $filter): void { $this->data->expects($this->once()) ->method('validateFilter') @@ -168,17 +139,14 @@ public function testValidateParametersFilter(string $param, string $filter): voi $this->assertSame($filter, self::invokePrivate($this->controller, 'filter')); } - public function dataValidateParametersFilterInvalid(): array { + public static function dataValidateParametersFilterInvalid(): array { return [ ['invalid1'], ['invalid2'], ]; } - /** - * @dataProvider dataValidateParametersFilterInvalid - * @param string $filter - */ + #[DataProvider('dataValidateParametersFilterInvalid')] public function testValidateParametersFilterInvalid(string $filter): void { $this->data->expects($this->once()) ->method('validateFilter') @@ -192,7 +160,7 @@ public function testValidateParametersFilterInvalid(string $filter): void { $this->assertSame($filter, self::invokePrivate($this->controller, 'filter')); } - public function dataValidateParametersObject(): array { + public static function dataValidateParametersObject(): array { return [ ['type', 42, 'type', 42], ['type', '42', 'type', 42], @@ -201,14 +169,8 @@ public function dataValidateParametersObject(): array { ]; } - /** - * @dataProvider dataValidateParametersObject - * @param mixed $type - * @param mixed $id - * @param string $expectedType - * @param int $expectedId - */ - public function testValidateParametersObject(?string $type, $id, string $expectedType, int $expectedId): void { + #[DataProvider('dataValidateParametersObject')] + public function testValidateParametersObject(?string $type, mixed $id, string $expectedType, int $expectedId): void { $this->data->expects($this->once()) ->method('validateFilter') ->willReturnArgument(0); @@ -221,7 +183,7 @@ public function testValidateParametersObject(?string $type, $id, string $expecte $this->assertSame($expectedId, self::invokePrivate($this->controller, 'objectId')); } - public function dataValidateParameters(): array { + public static function dataValidateParameters(): array { return [ ['since', 0, 'since', 0], ['since', 20, 'since', 20], @@ -237,14 +199,8 @@ public function dataValidateParameters(): array { ]; } - /** - * @dataProvider dataValidateParameters - * @param string $param - * @param string $value - * @param mixed $memberName - * @param mixed $expectedValue - */ - public function testValidateParameters(string $param, $value, string $memberName, $expectedValue): void { + #[DataProvider('dataValidateParameters')] + public function testValidateParameters(string $param, mixed $value, string $memberName, mixed $expectedValue): void { $params = ['all', 0, 0, false, '', 0, 'desc']; switch ($param) { case 'since': @@ -272,17 +228,14 @@ public function testValidateParameters(string $param, $value, string $memberName $this->assertSame($expectedValue, self::invokePrivate($this->controller, $memberName)); } - public function dataValidateParametersUser(): array { + public static function dataValidateParametersUser(): array { return [ ['uid1'], ['uid2'], ]; } - /** - * @dataProvider dataValidateParametersUser - * @param string $uid - */ + #[DataProvider('dataValidateParametersUser')] public function testValidateParametersUser(string $uid): void { $user = $this->createMock(IUser::class); $user->expects($this->once()) @@ -313,24 +266,14 @@ public function testValidateParametersUserInvalid(): void { $this->assertNull(self::invokePrivate($this->controller, 'user')); } - public function dataParameters(): array { + public static function dataParameters(): array { return [ ['all', 0, 0, false, '', 0, 'desc'], ['filter', 1, 25, true, 'files', 42, 'asc'], ]; } - /** - * @dataProvider dataParameters - * - * @param string $filter - * @param int $since - * @param int $limit - * @param bool $previews - * @param string $filterObjectType - * @param int $filterObjectId - * @param string $sort - */ + #[DataProvider('dataParameters')] public function testGetDefault(string $filter, int $since, int $limit, bool $previews, string $filterObjectType, int $filterObjectId, string $sort): void { $controller = $this->getController([ 'get' @@ -343,17 +286,7 @@ public function testGetDefault(string $filter, int $since, int $limit, bool $pre $controller->getDefault($since, $limit, $previews, $filterObjectType, $filterObjectId, $sort); } - /** - * @dataProvider dataParameters - * - * @param string $filter - * @param int $since - * @param int $limit - * @param bool $previews - * @param string $filterObjectType - * @param int $filterObjectId - * @param string $sort - */ + #[DataProvider('dataParameters')] public function testGetFilter(string $filter, int $since, int $limit, bool $previews, string $filterObjectType, int $filterObjectId, string $sort): void { $controller = $this->getController([ 'get' @@ -366,7 +299,7 @@ public function testGetFilter(string $filter, int $since, int $limit, bool $prev $controller->getFilter($filter, $since, $limit, $previews, $filterObjectType, $filterObjectId, $sort); } - public function dataGetInvalid(): array { + public static function dataGetInvalid(): array { return [ [new InvalidFilterException(), null, Http::STATUS_NOT_FOUND], [new \OutOfBoundsException(), null, Http::STATUS_FORBIDDEN], @@ -376,15 +309,10 @@ public function dataGetInvalid(): array { ]; } - /** - * @dataProvider dataGetInvalid - * @param \Exception $readParamsThrows - * @param bool|\Exception $dataGetThrows - * @param int $expected - */ - public function testGetInvalid(?\Exception $readParamsThrows, $dataGetThrows, int $expected): void { + #[DataProvider('dataGetInvalid')] + public function testGetInvalid(?\Exception $readParamsThrows, bool|\Exception|null $dataGetThrows, int $expected): void { $controller = $this->getController(['validateParameters', 'generateHeaders']); - $controller->expects($this->any()) + $controller ->method('generateHeaders') ->willReturnArgument(0); @@ -434,7 +362,6 @@ public function testListFilters(): void { $controller = $this->getController(); $response = $controller->listFilters(); - $this->assertInstanceOf(DataResponse::class, $response); $this->assertSame(Http::STATUS_OK, $response->getStatus()); $this->assertSame([ ['id' => 'id3', 'name' => 'Filter 1', 'icon' => 'id35', 'priority' => 5], @@ -445,52 +372,43 @@ public function testListFilters(): void { protected function createFilterMock(int $priority, string $id, string $name): IFilter { $filter = $this->createMock(IFilter::class); - $filter->expects($this->any()) + $filter ->method('getPriority') ->willReturn($priority); - $filter->expects($this->any()) + $filter ->method('getIdentifier') ->willReturn($id); - $filter->expects($this->any()) + $filter ->method('getName') ->willReturn($name); - $filter->expects($this->any()) + $filter ->method('getIcon') ->willReturn($id . $priority); return $filter; } - public function dataGet(): array { + public static function dataGet(): array { return [ - [123456789, 'files', 42, [], false, 0, ['object_type' => 'files', 'object_id' => 42, 'datetime' => date(\DateTime::ATOM, 123456789)]], - [12345678, 'calendar', 23, [], true, 0, ['object_type' => 'calendar', 'object_id' => 23, 'datetime' => date(\DateTime::ATOM, 12345678), 'previews' => []]], + [123456789, 'files', 42, [], false, 0, ['object_type' => 'files', 'object_id' => 42, 'datetime' => date(DateTimeInterface::ATOM, 123456789)]], + [12345678, 'calendar', 23, [], true, 0, ['object_type' => 'calendar', 'object_id' => 23, 'datetime' => date(DateTimeInterface::ATOM, 12345678), 'previews' => []]], [ 12345678, 'files', 23, ['objects' => [], 'affecteduser' => 'user1', 'object_name' => 'file.txt'], true, 1, - ['object_type' => 'files', 'object_id' => 23, 'objects' => [], 'object_name' => 'file.txt', 'datetime' => date(\DateTime::ATOM, 12345678), 'previews' => [['preview']]] + ['object_type' => 'files', 'object_id' => 23, 'objects' => [], 'object_name' => 'file.txt', 'datetime' => date(DateTimeInterface::ATOM, 12345678), 'previews' => [['preview']]] ], [ 12345678, 'files', 23, ['objects' => [12 => '12.png', 23 => '23.txt', 0 => '0.txt', 123 => ''], 'affecteduser' => 'user1'], true, 2, - ['object_type' => 'files', 'object_id' => 23, 'objects' => [12 => '12.png', 23 => '23.txt', 0 => '0.txt', 123 => ''], 'datetime' => date(\DateTime::ATOM, 12345678), 'previews' => [['preview'], ['preview']]] + ['object_type' => 'files', 'object_id' => 23, 'objects' => [12 => '12.png', 23 => '23.txt', 0 => '0.txt', 123 => ''], 'datetime' => date(DateTimeInterface::ATOM, 12345678), 'previews' => [['preview'], ['preview']]] ], ]; } - /** - * @dataProvider dataGet - * @param int $time - * @param string $objectType - * @param int $objectId - * @param array $additionalArgs - * @param bool $loadPreviews - * @param int $numGetPreviewCalls - * @param array $expected - */ + #[DataProvider('dataGet')] public function testGet(int $time, string $objectType, int $objectId, array $additionalArgs, bool $loadPreviews, int $numGetPreviewCalls, array $expected): void { $controller = $this->getController(['validateParameters', 'generateHeaders', 'getPreview']); - $controller->expects($this->any()) + $controller ->method('generateHeaders') ->willReturnArgument(0); @@ -523,21 +441,17 @@ public function testGet(int $time, string $objectType, int $objectId, array $add ], $result->getData()); } - public function dataGetNotModified(): array { + public static function dataGetNotModified(): array { return [ [[], null], [[[]], md5('foobar')], ]; } - /** - * @dataProvider dataGetNotModified - * @param array $data - * @param string|null $etag - */ + #[DataProvider('dataGetNotModified')] public function testGetNotModified(array $data, ?string $etag): void { $controller = $this->getController(['validateParameters', 'generateHeaders']); - $controller->expects($this->any()) + $controller ->method('generateHeaders') ->willReturnArgument(0); @@ -564,7 +478,7 @@ public function testGetNotModified(array $data, ?string $etag): void { $this->assertSame([], $result->getData()); } - public function dataGenerateHeaders(): array { + public static function dataGenerateHeaders(): array { return [ ['asc', 25, '', 0, null, ['X-Activity-Last-Given' => 23], false, [], ['X-Activity-Last-Given' => 23, 'ETag' => 'd751713988987e9331980363e24189ce']], ['asc', 25, '', 0, null, ['X-Activity-Last-Given' => 23], false, [['activity_id' => 23]], ['X-Activity-Last-Given' => 23, 'ETag' => 'b37e127599eef3cfeceac50e34cd5037']], @@ -575,25 +489,13 @@ public function dataGenerateHeaders(): array { ]; } - /** - * @dataProvider dataGenerateHeaders - * - * @param string $sort - * @param int $limit - * @param string $objectType - * @param int $objectId - * @param string $format - * @param array $headersIn - * @param bool $hasMoreActivities - * @param array $data - * @param array $expected - */ + #[DataProvider('dataGenerateHeaders')] public function testGenerateHeaders(string $sort, int $limit, string $objectType, int $objectId, ?string $format, array $headersIn, bool $hasMoreActivities, array $data, array $expected): void { self::invokePrivate($this->controller, 'sort', [$sort]); self::invokePrivate($this->controller, 'limit', [$limit]); self::invokePrivate($this->controller, 'objectType', [$objectType]); self::invokePrivate($this->controller, 'objectId', [$objectId]); - $this->request->expects($this->any()) + $this->request ->method('getParam') ->with('format') ->willReturn($format); @@ -602,7 +504,7 @@ public function testGenerateHeaders(string $sort, int $limit, string $objectType $this->assertEquals($expected, $headers); } - public function dataGetPreviewInvalidPaths(): array { + public static function dataGetPreviewInvalidPaths(): array { return [ ['author', 42, '/path', null, null], ['author', 42, '/path', '', null], @@ -610,15 +512,7 @@ public function dataGetPreviewInvalidPaths(): array { ]; } - /** - * @dataProvider dataGetPreviewInvalidPaths - * - * @param string $author - * @param int $fileId - * @param string $path - * @param string $returnedPath - * @param null|bool $exists - */ + #[DataProvider('dataGetPreviewInvalidPaths')] public function testGetPreviewInvalidPaths(string $author, int $fileId, string $path, ?string $returnedPath, ?bool $exists): void { $this->infoCache->expects($this->once()) ->method('getInfoById') @@ -633,7 +527,7 @@ public function testGetPreviewInvalidPaths(string $author, int $fileId, string $ $controller = $this->getController([ 'getPreviewFromPath' ]); - $controller->expects($this->any()) + $controller ->method('getPreviewFromPath') ->with($fileId, $path) ->willReturn(['getPreviewFromPath']); @@ -641,7 +535,7 @@ public function testGetPreviewInvalidPaths(string $author, int $fileId, string $ $this->assertSame(['getPreviewFromPath'], self::invokePrivate($controller, 'getPreview', [$author, $fileId, $path])); } - public function dataGetPreview(): array { + public static function dataGetPreview(): array { return [ ['author', 42, '/path', '/currentPath', true, true, false, '/preview/dir', true, 'dir'], ['author', 42, '/file.txt', '/currentFile.txt', false, true, false, '/preview/mpeg', true, 'audio/mp3'], @@ -650,20 +544,7 @@ public function dataGetPreview(): array { ]; } - /** - * @dataProvider dataGetPreview - * - * @param string $author - * @param int $fileId - * @param string $path - * @param string $returnedPath - * @param bool $isDir - * @param bool $validFileInfo - * @param bool $isMimeSup - * @param string $source - * @param bool $isMimeTypeIcon - * @param string $mimeType - */ + #[DataProvider('dataGetPreview')] public function testGetPreview(string $author, int $fileId, string $path, string $returnedPath, bool $isDir, bool $validFileInfo, bool $isMimeSup, string $source, bool $isMimeTypeIcon, string $mimeType): void { $controller = $this->getController([ 'getPreviewFromPath', @@ -671,7 +552,7 @@ public function testGetPreview(string $author, int $fileId, string $path, string ]); $node = $this->createMock(\OCP\Files\File::class); - $this->urlGenerator->expects($this->any()) + $this->urlGenerator ->method('linkToRouteAbsolute') ->willReturnCallback(function ($url, $params) { return $url . '#' . ($params['fileid'] ?? $params['fileId']); @@ -745,7 +626,7 @@ public function testGetPreview(string $author, int $fileId, string $path, string self::invokePrivate($controller, 'getPreview', [$author, $fileId, $path])); } - public function dataGetPreviewFromPath(): array { + public static function dataGetPreviewFromPath(): array { return [ [23, 'dir', 'dir', true, ''], [42, 'test.txt', 'text/plain', false, 'trashbin'], @@ -753,14 +634,7 @@ public function dataGetPreviewFromPath(): array { ]; } - /** - * @dataProvider dataGetPreviewFromPath - * @param int $fileId - * @param string $filePath - * @param string $mimeType - * @param bool $isDir - * @param string $view - */ + #[DataProvider('dataGetPreviewFromPath')] public function testGetPreviewFromPath(int $fileId, string $filePath, string $mimeType, bool $isDir, string $view): void { $controller = $this->getController([ 'getPreviewPathFromMimeType', @@ -770,7 +644,7 @@ public function testGetPreviewFromPath(int $fileId, string $filePath, string $mi ->method('getPreviewPathFromMimeType') ->with($mimeType) ->willReturn('mime-type-icon'); - $this->urlGenerator->expects($this->any()) + $this->urlGenerator ->method('linkToRouteAbsolute') ->willReturnCallback(function ($url, $params) { return $url . '#' . ($params['fileid'] ?? $params['fileId']); @@ -793,7 +667,7 @@ public function testGetPreviewFromPath(int $fileId, string $filePath, string $mi ); } - public function dataGetPreviewPathFromMimeType(): array { + public static function dataGetPreviewPathFromMimeType(): array { return [ ['dir', 'folder.png', 'absolute-folder.svg'], ['text/plain', 'text.svg', 'absolute-text.svg'], @@ -801,12 +675,7 @@ public function dataGetPreviewPathFromMimeType(): array { ]; } - /** - * @dataProvider dataGetPreviewPathFromMimeType - * @param string $mimeType - * @param string $icon - * @param string $expected - */ + #[DataProvider('dataGetPreviewPathFromMimeType')] public function testGetPreviewPathFromMimeType(string $mimeType, string $icon, string $expected): void { $this->mimeTypeDetector->expects($this->once()) ->method('mimeTypeIcon') diff --git a/tests/Controller/ActivitiesControllerTest.php b/tests/Controller/ActivitiesControllerTest.php index 26d0aa56a..0d1bf9b30 100644 --- a/tests/Controller/ActivitiesControllerTest.php +++ b/tests/Controller/ActivitiesControllerTest.php @@ -27,42 +27,32 @@ use OCA\Activity\Data; use OCA\Activity\Tests\TestCase; use OCP\Activity\IManager; -use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; use OCP\IURLGenerator; +use OCP\Server; use OCP\Template; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\MockObject\MockObject; /** * Class ActivitiesTest - * - * @group DB * @package OCA\Activity\Tests\Controller */ +#[Group('DB')] class ActivitiesControllerTest extends TestCase { - /** @var IRequest|MockObject */ - protected $request; - /** @var IConfig|MockObject */ - protected $config; - /** @var Data|MockObject */ - protected $data; - /** @var IEventDispatcher|MockObject */ - protected $eventDispatcher; - /** @var IL10N|MockObject */ - protected $l10n; - /** @var IInitialState|MockObject */ - protected $initialState; - /** @var IURLGenerator|MockObject */ - protected $urlGenerator; - /** @var IManager|MockObject */ - protected $activityManager; - - /** @var ActivitiesController */ - protected $controller; + protected MockObject&IRequest $request; + protected IConfig&MockObject $config; + protected Data&MockObject $data; + protected IEventDispatcher&MockObject $eventDispatcher; + protected MockObject&IL10N $l10n; + protected IInitialState&MockObject $initialState; + protected MockObject&IURLGenerator $urlGenerator; + protected IManager&MockObject $activityManager; + protected ActivitiesController $controller; protected function setUp(): void { parent::setUp(); @@ -113,7 +103,8 @@ protected function getController(array $methods = []): ActivitiesController { } public function testShowList(): void { - $template = new Template('activity', 'stream.app.navigation', ''); + $manager = Server::get(Template\ITemplateManager::class); + $template = $manager->getTemplate('activity', 'stream.app.navigation', ''); $template->assign('activeNavigation', 'all'); $template->assign('navigations', []); $template->assign('rssLink', ''); @@ -123,14 +114,12 @@ public function testShowList(): void { ->method('dispatch') ->with('OCA\Activity::loadAdditionalScripts', $this->anything()); - $this->data->expects($this->any()) + $this->data ->method('validateFilter') ->with('all') ->willReturn('all'); $templateResponse = $this->controller->showList(); - $this->assertInstanceOf(TemplateResponse::class, $templateResponse, 'Asserting type of return is \OCP\AppFramework\Http\TemplateResponse'); - $renderedResponse = $templateResponse->render(); $this->assertNotEmpty($renderedResponse); } diff --git a/tests/Controller/FeedControllerTest.php b/tests/Controller/FeedControllerTest.php index 13cf686bf..da963ada3 100644 --- a/tests/Controller/FeedControllerTest.php +++ b/tests/Controller/FeedControllerTest.php @@ -37,39 +37,23 @@ use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserSession; +use OCP\L10N\IFactory; +use OCP\Server; use OCP\Util; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; +use UnexpectedValueException; class FeedControllerTest extends TestCase { - /** @var IConfig|MockObject */ - protected $config; - - /** @var IRequest|MockObject */ - protected $request; - - /** @var Data|MockObject */ - protected $data; - - /** @var GroupHelper|MockObject */ - protected $helper; - - /** @var UserSettings|MockObject */ - protected $userSettings; - - /** @var IManager|MockObject */ - protected $manager; - - /** @var IUserSession|MockObject */ - protected $session; - - /** @var \OCP\IL10N */ - protected $l10n; - - /** @var ThemingDefaults|MockObject */ - protected $themingDefault; - - /** @var FeedController */ - protected $controller; + protected IConfig&MockObject $config; + protected MockObject&IRequest $request; + protected Data&MockObject $data; + protected GroupHelper&MockObject $helper; + protected UserSettings&MockObject $userSettings; + protected IManager&MockObject $manager; + protected IUserSession&MockObject $session; + protected ThemingDefaults&MockObject $themingDefault; + protected FeedController $controller; protected function setUp(): void { parent::setUp(); @@ -77,14 +61,12 @@ protected function setUp(): void { $this->data = $this->createMock(Data::class); $this->helper = $this->createMock(GroupHelper::class); $this->userSettings = $this->createMock(UserSettings::class); - $this->config = $this->createMock(IConfig::class); $this->request = $this->createMock(IRequest::class); $this->session = $this->createMock(IUserSession::class); $this->manager = $this->createMock(IManager::class); $this->themingDefault = $this->createMock(ThemingDefaults::class); - - /** @var IURLGenerator|MockObject $urlGenerator */ + /** @var IURLGenerator&MockObject $urlGenerator */ $urlGenerator = $this->createMock(IURLGenerator::class); $this->controller = new FeedController( @@ -95,33 +77,28 @@ protected function setUp(): void { $this->userSettings, $urlGenerator, $this->manager, - \OC::$server->getL10NFactory(), + Server::get(IFactory::class), $this->config, $this->themingDefault, ); } - public function showData(): array { + public static function showData(): array { return [ ['application/rss+xml', 'application/rss+xml'], [null, 'text/xml; charset=UTF-8'], ]; } - /** - * @dataProvider showData - * - * @param string $acceptHeader - * @param string $expectedHeader - */ + #[DataProvider('showData')] public function testShow(?string $acceptHeader, string $expectedHeader): void { $this->mockUserSession('test'); - $this->data->expects($this->any()) + $this->data ->method('get') ->willReturn(['data' => []]); if ($acceptHeader !== null) { - $this->request->expects($this->any()) + $this->request ->method('getHeader') ->willReturn($acceptHeader); } @@ -141,18 +118,13 @@ public function testShow(?string $acceptHeader, string $expectedHeader): void { $this->assertStringNotContainsString($description, $renderedResponse); } - /** - * @dataProvider showData - * - * @param string $acceptHeader - * @param string $expectedHeader - */ + #[DataProvider('showData')] public function testShowNoToken(?string $acceptHeader, string $expectedHeader): void { - $this->manager->expects($this->any()) + $this->manager ->method('getCurrentUserId') - ->willThrowException(new \UnexpectedValueException()); + ->willThrowException(new UnexpectedValueException()); if ($acceptHeader !== null) { - $this->request->expects($this->any()) + $this->request ->method('getHeader') ->willReturn($acceptHeader); } @@ -168,23 +140,23 @@ public function testShowNoToken(?string $acceptHeader, string $expectedHeader): $this->assertNotEmpty($renderedResponse); $l = Util::getL10N('activity'); - $description = (string)$l->t('Your feed URL is invalid'); + $description = $l->t('Your feed URL is invalid'); $this->assertStringContainsString($description, $renderedResponse); } protected function mockUserSession(string $user): void { $mockUser = $this->createMock(IUser::class); - $mockUser->expects($this->any()) + $mockUser ->method('getUID') ->willReturn($user); - $this->session->expects($this->any()) + $this->session ->method('isLoggedIn') ->willReturn(true); - $this->session->expects($this->any()) + $this->session ->method('getUser') ->willReturn($mockUser); - $this->manager->expects($this->any()) + $this->manager ->method('getCurrentUserId') ->willReturn($user); } diff --git a/tests/CurrentUserTest.php b/tests/CurrentUserTest.php index cf30a398a..28a28ce6a 100644 --- a/tests/CurrentUserTest.php +++ b/tests/CurrentUserTest.php @@ -22,6 +22,7 @@ namespace OCA\Activity\Tests; +use Exception; use OCA\Activity\CurrentUser; use OCP\IRequest; use OCP\IUser; @@ -30,6 +31,7 @@ use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IManager; use OCP\Share\IShare; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; /* We have to use this to add a property to the mocked request and avoid warnings about dynamic properties on PHP>=8.2 */ @@ -57,11 +59,7 @@ protected function setUp(): void { $this->l10nFactory = $this->createMock(IFactory::class); } - /** - * @param array $methods - * @return CurrentUser&MockObject - */ - protected function getInstance(array $methods = []): CurrentUser { + protected function getInstance(array $methods = []): CurrentUser|MockObject { if (empty($methods)) { return new CurrentUser( $this->userSession, @@ -82,7 +80,7 @@ protected function getInstance(array $methods = []): CurrentUser { ->getMock(); } - public function dataGetUserIdentifier(): array { + public static function dataGetUserIdentifier(): array { return [ [null, null, null, ''], [null, 'uid', -1, 'uid'], @@ -91,15 +89,8 @@ public function dataGetUserIdentifier(): array { ]; } - /** - * @dataProvider dataGetUserIdentifier - * - * @param string|null $cachedIdentifier - * @param string|int|null $uidResult - * @param string|int|null $tokenResult - * @param string $expected - */ - public function testGetUserIdentifier(?string $cachedIdentifier, $uidResult, $tokenResult, string $expected): void { + #[DataProvider('dataGetUserIdentifier')] + public function testGetUserIdentifier(?string $cachedIdentifier, string|int|null $uidResult, string|int|null $tokenResult, string $expected): void { $instance = $this->getInstance([ 'getUID', 'getCloudIDFromToken', @@ -118,10 +109,6 @@ public function testGetUserIdentifier(?string $cachedIdentifier, $uidResult, $to $this->assertSame($expected, $instance->getUserIdentifier()); } - /** - * @param string $uid - * @return IUser - */ protected function getUserMock(string $uid): IUser { $user = $this->createMock(IUser::class); $user->expects($this->once()) @@ -130,23 +117,24 @@ protected function getUserMock(string $uid): IUser { return $user; } - public function dataGetUID(): array { + public static function dataGetUID(): array { return [ [null, null], - [$this->getUserMock('uid'), 'uid'], - [$this->getUserMock('test'), 'test'], + ['uid', 'uid'], + ['test', 'test'], ]; } - /** - * @dataProvider dataGetUID - * - * @param IUser|null $user - * @param string|null $expected - */ - public function testGetUID(?IUser $user, ?string $expected): void { - $instance = $this->getInstance(); + #[DataProvider('dataGetUID')] + public function testGetUID(?string $uid, ?string $expected): void { + if ($uid === null) { + $this->userSession->expects($this->never()) + ->method('getUser'); + return; + } + $user = $this->getUserMock($uid); + $instance = $this->getInstance(); $this->userSession->expects($this->once()) ->method('getUser') ->willReturn($user); @@ -154,12 +142,16 @@ public function testGetUID(?IUser $user, ?string $expected): void { $this->assertSame($expected, $instance->getUID()); } - /** - * @param int $type - * @param string $shareWith - * @return IShare - */ - protected function getShareMock(int $type, ?string $shareWith): IShare { + protected function getShareMock(array $share): IShare|Exception|null { + if (empty($share)) { + return null; + } + if ($share[0] instanceof ShareNotFound) { + return $share[0]; + } + [$type, $shareWith] = $share; + + $share = $this->createMock(IShare::class); $share->expects($this->once()) ->method('getShareType') @@ -170,31 +162,25 @@ protected function getShareMock(int $type, ?string $shareWith): IShare { return $share; } - public function dataGetCloudIDFromToken(): array { + public static function dataGetCloudIDFromToken(): array { return [ - [[], null, null], - [['PHP_AUTH_USER' => 'token23'], $this->getShareMock(IShare::TYPE_LINK, null), null], - [['PHP_AUTH_USER' => 'token32'], new ShareNotFound(), null], - [['PHP_AUTH_USER' => 'token42'], $this->getShareMock(IShare::TYPE_REMOTE, 'test@localhost'), 'test@localhost'], + [[], [], null], + [['PHP_AUTH_USER' => 'token23'], [IShare::TYPE_LINK, null], null], + [['PHP_AUTH_USER' => 'token32'], [new ShareNotFound()], null], + [['PHP_AUTH_USER' => 'token42'], [IShare::TYPE_REMOTE, 'test@localhost'], 'test@localhost'], ]; } - /** - * @dataProvider dataGetCloudIDFromToken - * - * @param array $server - * @param IShare|\Exception|null $share - * @param string|null $expected - */ - public function testGetCloudIDFromToken(array $server, $share, ?string $expected): void { + #[DataProvider('dataGetCloudIDFromToken')] + public function testGetCloudIDFromToken(array $server, array $shareData, ?string $expected): void { $instance = $this->getInstance(); - $this->request->server = $server; + $share = $this->getShareMock($shareData); if ($share === null) { $this->shareManager->expects($this->never()) ->method('getShareByToken'); - } elseif ($share instanceof \Exception) { + } elseif ($share instanceof Exception) { $this->shareManager->expects($this->once()) ->method('getShareByToken') ->with($server['PHP_AUTH_USER']) diff --git a/tests/DataDeleteActivitiesTest.php b/tests/DataDeleteActivitiesTest.php index fd1c2f971..6d73127d0 100644 --- a/tests/DataDeleteActivitiesTest.php +++ b/tests/DataDeleteActivitiesTest.php @@ -32,6 +32,10 @@ use OCP\BackgroundJob\IJobList; use OCP\DB\IPreparedStatement; use OCP\IConfig; +use OCP\IDBConnection; +use OCP\Server; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use Psr\Log\LoggerInterface; /** @@ -40,9 +44,9 @@ * @group DB * @package OCA\Activity\Tests */ +#[Group('DB')] class DataDeleteActivitiesTest extends TestCase { - /** @var Data */ - protected $data; + protected Data $data; protected function setUp(): void { parent::setUp(); @@ -54,7 +58,8 @@ protected function setUp(): void { ['affectedUser' => 'otherUser', 'subject' => 'subject2', 'time' => time()], ]; - $queryActivity = \OC::$server->getDatabaseConnection()->prepare('INSERT INTO `*PREFIX*activity`(`app`, `subject`, `subjectparams`, `message`, `messageparams`, `file`, `link`, `user`, `affecteduser`, `timestamp`, `priority`, `type`)' . ' VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'); + $queryActivity = Server::get(IDBConnection::class) + ->prepare('INSERT INTO `*PREFIX*activity`(`app`, `subject`, `subjectparams`, `message`, `messageparams`, `file`, `link`, `user`, `affecteduser`, `timestamp`, `priority`, `type`)' . ' VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'); foreach ($activities as $activity) { $queryActivity->execute([ 'app', @@ -73,7 +78,7 @@ protected function setUp(): void { } $this->data = new Data( $this->createMock(IManager::class), - \OC::$server->getDatabaseConnection(), + Server::get(IDBConnection::class), $this->createMock(LoggerInterface::class), $this->createMock(IConfig::class), ); @@ -87,7 +92,7 @@ protected function tearDown(): void { parent::tearDown(); } - public function deleteActivitiesData(): array { + public static function deleteActivitiesData(): array { return [ [['affecteduser' => 'delete'], ['otherUser']], [['affecteduser' => ['delete', '=']], ['otherUser']], @@ -96,9 +101,7 @@ public function deleteActivitiesData(): array { ]; } - /** - * @dataProvider deleteActivitiesData - */ + #[DataProvider('deleteActivitiesData')] public function testDeleteActivities(array $condition, array $expected): void { $this->assertUserActivities(['delete', 'otherUser']); $this->data->deleteActivities($condition); @@ -122,8 +125,9 @@ public function testExpireActivities(): void { $this->assertUserActivities(['otherUser']); } - protected function assertUserActivities(array $expected) { - $query = \OC::$server->getDatabaseConnection()->prepare("SELECT `affecteduser` FROM `*PREFIX*activity` WHERE `type` = 'test'"); + protected function assertUserActivities(array $expected): void { + $query = Server::get(IDBConnection::class) + ->prepare("SELECT `affecteduser` FROM `*PREFIX*activity` WHERE `type` = 'test'"); $this->assertTableKeys($expected, $query, 'affecteduser'); } diff --git a/tests/DataTest.php b/tests/DataTest.php index 8b7247b76..f67c6f17e 100644 --- a/tests/DataTest.php +++ b/tests/DataTest.php @@ -24,52 +24,42 @@ namespace OCA\Activity\Tests; +use OCA\Activity\AppInfo\Application; use OCA\Activity\Data; use OCP\Activity\IManager; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; -use OCP\IUserSession; +use OCP\Server; use OCP\Util; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\NullLogger; /** * Class DataTest - * - * @group DB * @package OCA\Activity\Tests */ +#[Group('DB')] class DataTest extends TestCase { - /** @var Data */ - protected $data; - - /** @var IL10N */ - protected $activityLanguage; - - /** @var IUserSession|MockObject */ - protected $session; - - /** @var IDBConnection */ - protected $dbConnection; - - /** @var IManager */ - protected $realActivityManager; - - /** @var NullLogger */ - protected $logger; - + protected Data $data; + protected IL10N $activityLanguage; + protected IDBConnection $dbConnection; + protected IManager $realActivityManager; + protected NullLogger $logger; protected IConfig&MockObject $config; protected function setUp(): void { parent::setUp(); - $this->activityLanguage = Util::getL10N('activity', 'en'); + $this->activityLanguage = Util::getL10N(Application::APP_ID, 'en'); + $this->dbConnection = Server::get(IDBConnection::class); + $this->realActivityManager = Server::get(IManager::class); + $this->logger = Server::get(NullLogger::class); + $activityManager = $this->createMock(IManager::class); - $this->dbConnection = \OC::$server->get(IDBConnection::class); - $this->realActivityManager = \OC::$server->get(IManager::class); - $this->logger = \OC::$server->get(NullLogger::class); $this->config = $this->createMock(IConfig::class); $this->data = new Data( @@ -80,11 +70,7 @@ protected function setUp(): void { ); } - protected function tearDown(): void { - parent::tearDown(); - } - - public function dataSend(): array { + public static function dataSend(): array { return [ // Default case ['author', 'affectedUser', 'author', 'affectedUser', true], @@ -97,22 +83,14 @@ public function dataSend(): array { ]; } - /** - * @dataProvider dataSend - * - * @param string $actionUser - * @param string $affectedUser - * @param string $expectedAuthor - * @param string $expectedAffected - * @param bool $expectedActivity - */ + #[DataProvider('dataSend')] public function testSend(string $actionUser, string $affectedUser, string $expectedAuthor, string $expectedAffected, bool $expectedActivity): void { $this->deleteTestActivities(); $event = $this->realActivityManager->generateEvent(); $event->setApp('test') ->setType('type') - ->setSubject('subject', []); + ->setSubject('subject'); if ($affectedUser !== '') { $event->setAffectedUser($affectedUser); @@ -141,15 +119,7 @@ public function testSend(string $actionUser, string $affectedUser, string $expec $this->deleteTestActivities(); } - /** - * @dataProvider dataSend - * - * @param string $actionUser - * @param string $affectedUser - * @param string $expectedAuthor - * @param string $expectedAffected - * @param bool $expectedActivity - */ + #[DataProvider('dataSend')] public function testStoreMail(string $actionUser, string $affectedUser, string $expectedAuthor, string $expectedAffected, bool $expectedActivity): void { $this->deleteTestMails(); @@ -158,7 +128,7 @@ public function testStoreMail(string $actionUser, string $affectedUser, string $ $event = $this->realActivityManager->generateEvent(); $event->setApp('test') ->setType('type') - ->setSubject('subject', []) + ->setSubject('subject') ->setTimestamp($time); if ($affectedUser !== '') { @@ -184,7 +154,7 @@ public function testStoreMail(string $actionUser, string $affectedUser, string $ $this->deleteTestMails(); } - public function dataSetOffsetFromSince(): array { + public static function dataSetOffsetFromSince(): array { return [ ['ASC', '`timestamp` >= \'123465789\'', '`activity_id` > \'{id}\'', null, null, null], ['DESC', '`timestamp` <= \'123465789\'', '`activity_id` < \'{id}\'', null, null, null], @@ -194,17 +164,7 @@ public function dataSetOffsetFromSince(): array { ]; } - /** - * @dataProvider dataSetOffsetFromSince - * - * @param string $sort - * @param string|null $timestampWhere - * @param string|null $idWhere - * @param string|null $offsetUser - * @param int|bool|null $offsetId - * @param string|null $expectedHeader - * @throws \OCP\DB\Exception - */ + #[DataProvider('dataSetOffsetFromSince')] public function testSetOffsetFromSince(string $sort, ?string $timestampWhere, ?string $idWhere, ?string $offsetUser, $offsetId, ?string $expectedHeader): void { $this->deleteTestActivities(); $user = self::getUniqueID('testing'); @@ -232,22 +192,17 @@ public function testSetOffsetFromSince(string $sort, ?string $timestampWhere, ?s $mock = $this->getMockBuilder(IQueryBuilder::class) ->disableOriginalConstructor() ->getMock(); - $mock->expects($this->any()) + $mock ->method('expr') ->willReturn($query->expr()); - $mock->expects($this->any()) + $mock ->method('createNamedParameter') ->willReturnCallback(function ($arg) use ($query) { return $query->expr()->literal($arg); }); if ($timestampWhere !== null && $idWhere !== null) { $mock->expects($this->exactly(2)) - ->method('andWhere') -// ->withConsecutive( -// [$timestampWhere], -// [str_replace('{id}', $id, $idWhere)] -// ) - ; + ->method('andWhere'); } else { $mock->expects($this->never()) ->method('andWhere'); diff --git a/tests/FilesHooksTest.php b/tests/FilesHooksTest.php index 302a95a75..00dfbff0d 100644 --- a/tests/FilesHooksTest.php +++ b/tests/FilesHooksTest.php @@ -45,19 +45,21 @@ use OCP\IGroupManager; use OCP\IURLGenerator; use OCP\IUser; +use OCP\Server; use OCP\Share\IManager as ShareIManager; use OCP\Share\IShare; use OCP\Share\IShareHelper; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; /** * Class FilesHooksTest * Testing the public methods with internals being mocked out - * - * @group DB * @package OCA\Activity */ +#[Group('DB')] class FilesHooksTest extends TestCase { protected FilesHooks $filesHooks; protected IManager&MockObject $activityManager; @@ -72,12 +74,8 @@ class FilesHooksTest extends TestCase { protected IConfig&MockObject $config; protected NotificationGenerator&MockObject $notificationGenerator; protected TagManager&MockObject $tagManager; - protected $tags; - /** - * @todo With PHP 8.2 we can put this directly on the declaration instead of a comment but 8.1 does not allow the parenthesis - * @var (OCA\Circles\CirclesManager&MockObject)|null - */ - protected $teamManager; + protected Tags&MockObject $tags; + protected (OCA\Circles\CirclesManager&MockObject)|null $teamManager; protected function setUp(): void { parent::setUp(); @@ -93,29 +91,23 @@ protected function setUp(): void { $this->userMountCache = $this->createMock(IUserMountCache::class); $this->config = $this->createMock(IConfig::class); $this->notificationGenerator = $this->createMock(NotificationGenerator::class); - $this->tagManager = $this->createMock(TagManager::class); $this->tags = $this->createMock(Tags::class); + $this->teamManager = null; + $this->tagManager = $this->createMock(TagManager::class); $this->tagManager->method('getUsersFavoritingObject') ->willReturn([]); - $this->teamManager = null; - $this->tagManager->method('load') ->willReturn($this->tags); $this->filesHooks = $this->getFilesHooks(); } - /** - * @param array $mockedMethods - * @param string $user - * @return FilesHooks&MockObject - */ protected function getFilesHooks(array $mockedMethods = [], string $user = 'user'): FilesHooks { $currentUser = $this->createMock(CurrentUser::class); - $currentUser->expects($this->any()) + $currentUser ->method('getUID') ->willReturn($user); - $currentUser->expects($this->any()) + $currentUser ->method('getUserIdentifier') ->willReturn($user); /** @var LoggerInterface $logger */ @@ -131,7 +123,7 @@ protected function getFilesHooks(array $mockedMethods = [], string $user = 'user $this->view, $this->rootFolder, $this->shareHelper, - \OCP\Server::get(IDBConnection::class), + Server::get(IDBConnection::class), $this->urlGenerator, $logger, $currentUser, @@ -153,7 +145,7 @@ protected function getFilesHooks(array $mockedMethods = [], string $user = 'user $this->view, $this->rootFolder, $this->shareHelper, - \OCP\Server::get(IDBConnection::class), + Server::get(IDBConnection::class), $this->urlGenerator, $logger, $currentUser, @@ -167,7 +159,7 @@ protected function getFilesHooks(array $mockedMethods = [], string $user = 'user protected function getUserMock(string $uid): IUser { $user = $this->createMock(IUser::class); - $user->expects($this->any()) + $user ->method('getUID') ->willReturn($uid); return $user; @@ -180,13 +172,7 @@ public static function dataFileCreate(): array { ]; } - /** - * @dataProvider dataFileCreate - * - * @param mixed $currentUser - * @param string $selfSubject - * @param string $othersSubject - */ + #[DataProvider('dataFileCreate')] public function testFileCreate(string $currentUser, string $selfSubject, string $othersSubject, string $type): void { $filesHooks = $this->getFilesHooks([ 'addNotificationsForFileAction', @@ -199,11 +185,7 @@ public function testFileCreate(string $currentUser, string $selfSubject, string $filesHooks->fileCreate('path'); } - /** - * @dataProvider dataFileCreate - * - * @param string $currentUser - */ + #[DataProvider('dataFileCreate')] public function testFileCreateRoot(string $currentUser): void { $filesHooks = $this->getFilesHooks([ 'addNotificationsForFileAction', @@ -259,7 +241,7 @@ public function testAddNotificationsForFileActionPartFile(): void { $filesHooks->expects($this->never()) ->method('getSourcePathAndOwner'); - $this->invokePrivate($filesHooks, 'addNotificationsForFileAction', ['/test.txt.part', '', '', '']); + self::invokePrivate($filesHooks, 'addNotificationsForFileAction', ['/test.txt.part', '', '', '']); } public static function dataAddNotificationsForFileAction(): array { @@ -363,14 +345,7 @@ public static function dataAddNotificationsForFileAction(): array { ]; } - /** - * @dataProvider dataAddNotificationsForFileAction - * - * @param array $filterUsers - * @param bool $mountCacheUsed - * @param bool $isFavorite - * @param array $addNotifications - */ + #[DataProvider('dataAddNotificationsForFileAction')] public function testAddNotificationsForFileAction(array $filterUsers, bool $mountCacheUsed, bool $isFavorite, array $addNotifications): void { $filesHooks = $this->getFilesHooks([ 'getSourcePathAndOwner', @@ -447,7 +422,7 @@ public function testAddNotificationsForFileAction(array $filterUsers, bool $moun $this->settings->expects($this->exactly(2)) ->method('filterUsersBySetting') - ->willReturnCallback(function ($users, $method, $type) use ($filterUsers) { + ->willReturnCallback(function ($users, $method) use ($filterUsers) { return $filterUsers[$method]; }); @@ -466,7 +441,7 @@ public function testAddNotificationsForFileAction(array $filterUsers, bool $moun ]; } $receivedActivities = []; - $filesHooks->expects($this->any()) + $filesHooks ->method('addNotificationsForUser') ->willReturnCallback(function (...$params) use (&$receivedActivities) { $receivedActivities[] = $params; @@ -501,8 +476,8 @@ public function testHookShareWithUser(): void { ->method('shareWithUser') ->with('u1', $node, 'path'); - /** @var ShareIManager */ - $manager = \OC::$server->get(ShareIManager::class); + /** @var ShareIManager $manager */ + $manager = Server::get(ShareIManager::class); $share = $manager->newShare(); $share->setSharedWith('u1'); $share->setShareType(IShare::TYPE_USER); @@ -523,8 +498,8 @@ public function testHookShareWithGroup(): void { ->method('shareWithGroup') ->with('g1', $node, 'path', 42); - /** @var ShareIManager */ - $manager = \OC::$server->get(ShareIManager::class); + /** @var ShareIManager $manager */ + $manager = Server::get(ShareIManager::class); $share = $manager->newShare(); $share->setId('42'); $share->setSharedWith('g1'); @@ -546,8 +521,8 @@ public function testShareViaPublicLink(): void { ->method('shareByLink') ->with($node, 'admin'); - /** @var ShareIManager */ - $manager = \OC::$server->get(ShareIManager::class); + /** @var ShareIManager $manager */ + $manager = Server::get(ShareIManager::class); $share = $manager->newShare(); $share->setShareType(IShare::TYPE_LINK); $share->setNodeType('file'); @@ -564,13 +539,7 @@ public static function dataShareWithUser(): array { ]; } - /** - * @dataProvider dataShareWithUser - * - * @param string $itemType - * @param string $fileTarget - * @param bool $isFile - */ + #[DataProvider('dataShareWithUser')] public function testShareWithUser(string $itemType, string $fileTarget): void { $isFile = $itemType === 'file'; $filesHooks = $this->getFilesHooks([ @@ -689,15 +658,7 @@ public static function dataShareWithGroup(): array { ]; } - /** - * @dataProvider dataShareWithGroup - * @param array $usersInGroup - * @param int $settingCalls - * @param int $fixCalls - * @param array $settingUsers - * @param array $settingsReturn - * @param array $addNotifications - */ + #[DataProvider('dataShareWithGroup')] public function testShareWithGroup(array $usersInGroup, int $settingCalls, int $fixCalls, array $settingUsers, array $settingsReturn, array $addNotifications): void { foreach ($usersInGroup as &$users) { $users = array_map($this->getUserMock(...), $users); @@ -713,7 +674,7 @@ public function testShareWithGroup(array $usersInGroup, int $settingCalls, int $ ]); $group = $this->createMock(IGroup::class); - $group->expects($this->any()) + $group ->method('searchUsers') ->with('') ->willReturnOnConsecutiveCalls(...$usersInGroup); @@ -755,7 +716,7 @@ public function testShareWithGroup(array $usersInGroup, int $settingCalls, int $ ]; } $receivedActivities = []; - $filesHooks->expects($this->any()) + $filesHooks ->method('addNotificationsForUser') ->willReturnCallback(function (...$params) use (&$receivedActivities) { $receivedActivities[] = $params; @@ -844,15 +805,7 @@ public static function dataShareNotificationForOriginalOwners(): array { ]; } - /** - * @dataProvider dataShareNotificationForOriginalOwners - * - * @param bool $validMountPoint - * @param bool $validSharedStorage - * @param string $pathOwner - * @param string $shareeUser - * @param int $numReshareNotification - */ + #[DataProvider('dataShareNotificationForOriginalOwners')] public function testShareNotificationForOriginalOwners(bool $validMountPoint, bool $validSharedStorage, string $pathOwner, string $shareeUser, int $numReshareNotification): void { $filesHooks = $this->getFilesHooks([ 'reshareNotificationForSharer', @@ -931,22 +884,7 @@ public static function dataAddNotificationsForUser(): array { ]; } - /** - * @dataProvider dataAddNotificationsForUser - * - * @param string $user - * @param string $subject - * @param array $parameter - * @param int $fileId - * @param string $path - * @param string $urlPath - * @param bool $isFile - * @param bool $notification - * @param bool $email - * @param string $type - * @param string $app - * @param bool $sentEmail - */ + #[DataProvider('dataAddNotificationsForUser')] public function testAddNotificationsForUser(string $user, string $subject, array $parameter, int $fileId, string $path, string $urlPath, bool $isFile, bool $notification, bool $email, string $type, string $app, bool $sentEmail): void { $this->urlGenerator->expects($this->once()) ->method('linkToRouteAbsolute') diff --git a/tests/GroupHelperTest.php b/tests/GroupHelperTest.php index 328ec1385..1f4a53219 100644 --- a/tests/GroupHelperTest.php +++ b/tests/GroupHelperTest.php @@ -24,24 +24,23 @@ namespace OCA\Activity\Tests; +use OCA\Activity\AppInfo\Application; use OCA\Activity\GroupHelper; use OCA\Activity\GroupHelperDisabled; use OCP\Activity\IEvent; use OCP\Activity\IManager; use OCP\IL10N; +use OCP\L10N\IFactory; use OCP\RichObjectStrings\IValidator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; class GroupHelperTest extends TestCase { - /** @var IManager|MockObject */ - protected $activityManager; - /** @var IValidator|MockObject */ - protected $validator; - /** @var LoggerInterface|MockObject */ - protected $logger; - /** @var IL10N|MockObject */ - protected $l; + protected IManager&MockObject $activityManager; + protected IValidator&MockObject $validator; + protected MockObject&LoggerInterface $logger; + protected MockObject&IL10N $l; protected function setUp(): void { parent::setUp(); @@ -52,12 +51,7 @@ protected function setUp(): void { $this->logger = $this->createMock(LoggerInterface::class); } - /** - * @param array $methods - * @param bool $grouping - * @return GroupHelper|MockObject - */ - protected function getHelper(array $methods = [], $grouping = false): GroupHelper { + protected function getHelper(array $methods = [], bool $grouping = false): GroupHelper|MockObject { if (empty($methods)) { if ($grouping) { return new GroupHelper( @@ -88,14 +82,13 @@ protected function getHelper(array $methods = [], $grouping = false): GroupHelpe public function testSetL10n(): void { $helper = $this->getHelper(); - - $l = \OC::$server->getL10NFactory()->get('activity', 'de'); - + $l = \OCP\Server::get(IFactory::class)->get(Application::APP_ID, 'de'); $helper->setL10n($l); + $this->assertTrue(true); } - public function dataGetEventFromArray(): array { + public static function dataGetEventFromArray(): array { return [ [ [ @@ -134,10 +127,7 @@ public function dataGetEventFromArray(): array { ]; } - /** - * @dataProvider dataGetEventFromArray - * @param array $activity - */ + #[DataProvider('dataGetEventFromArray')] public function testGetEventFromArray(array $activity): void { $event = $this->createMock(IEvent::class); $event->expects($this->once()) @@ -206,7 +196,7 @@ protected function createEvent(array $data): IEvent { return $event; } - public function dataGetObjectsFromChildren(): array { + public static function dataGetObjectsFromChildren(): array { return [ [['id' => 0, 'name' => ''], []], [['id' => 12, 'name' => ''], [12 => '']], @@ -216,11 +206,7 @@ public function dataGetObjectsFromChildren(): array { ]; } - /** - * @dataProvider dataGetObjectsFromChildren - * @param array $data - * @param array $expected - */ + #[DataProvider('dataGetObjectsFromChildren')] public function testGetObjectsFromChildren(array $data, array $expected): void { $event = $this->createEvent($data); $helper = $this->getHelper(); diff --git a/tests/Listener/SetUserDefaultsTest.php b/tests/Listener/SetUserDefaultsTest.php index 856806a3e..7614e0821 100644 --- a/tests/Listener/SetUserDefaultsTest.php +++ b/tests/Listener/SetUserDefaultsTest.php @@ -25,60 +25,71 @@ namespace OCA\Activity\Tests\Listener; use OCA\Activity\Listener\SetUserDefaults; +use OCP\IAppConfig; use OCP\IConfig; use OCP\IUser; use OCP\User\Events\PostLoginEvent; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class SetUserDefaultsTest extends TestCase { - /** - * @var IConfig|MockObject - */ - private $config; - - /** - * @var SetUserDefaults - */ - private $listener; - - /** @var IUser|MockObject */ - private $user; - - /** @var PostLoginEvent */ - private $event; + private IConfig&MockObject $config; + private IAppConfig&MockObject $appConfig; + private SetUserDefaults $listener; + private PostLoginEvent $event; public const UID = 'myuser'; public function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); - $this->user = $this->createMock(IUser::class); - $this->user->expects($this->atLeast(1))->method('getUID')->willReturn(self::UID); - $this->event = new PostLoginEvent($this->user, self::UID, 'somepassword', true); + $this->appConfig = $this->createMock(IAppConfig::class); + $user = $this->createMock(IUser::class); + $user->expects($this->atLeast(1))->method('getUID')->willReturn(self::UID); + $this->event = new PostLoginEvent($user, self::UID, 'somepassword', true); - $this->listener = new SetUserDefaults($this->config); + $this->listener = new SetUserDefaults($this->config, $this->appConfig); } public function testSettingUserDefaultsAlreadyConfigured(): void { $this->config->expects($this->once())->method('getUserValue')->with(self::UID, 'activity', 'configured', 'no')->willReturn('yes'); - $this->config->expects($this->never())->method('getAppKeys'); + $this->appConfig->expects($this->never())->method('getKeys'); $this->listener->handle($this->event); } - /** - * @dataProvider dataForTestSettingUserDefaultsNotConfigured - */ + #[DataProvider('dataForTestSettingUserDefaultsNotConfigured')] public function testSettingUserDefaultsNotConfigured(string $key, array $getUserValueArgs, array $getUserValueReturns, array $setUserValuesArgs): void { - $this->config->expects($this->exactly(count($getUserValueArgs)))->method('getUserValue')->withConsecutive(...$getUserValueArgs)->willReturnOnConsecutiveCalls(...$getUserValueReturns); - $this->config->expects($this->exactly(count($setUserValuesArgs)))->method('setUserValue')->withConsecutive(...$setUserValuesArgs); - $this->config->expects($this->exactly(count($setUserValuesArgs) > 1 ? 1 : 0))->method('getAppValue')->with('activity', $key)->willReturn('defaultAppValue'); - $this->config->expects($this->once())->method('getAppKeys')->willReturn([$key]); + $matcher = $this->exactly(count($getUserValueArgs)); + $this->config + ->expects($matcher) + ->method('getUserValue') + ->willReturnCallback(function () use ($matcher, $getUserValueReturns) { + $invocation = $matcher->numberOfInvocations(); + return $getUserValueReturns[$invocation - 1]; + }); + $matcher = $this->exactly(count($setUserValuesArgs)); + $this->config + ->expects($matcher) + ->method('setUserValue') + ->willReturnCallback(function () use ($matcher, $setUserValuesArgs) { + $invocation = $matcher->numberOfInvocations(); + return $setUserValuesArgs[$invocation - 1]; + }); + $this->appConfig + ->expects($this->exactly(count($setUserValuesArgs) > 1 ? 1 : 0)) + ->method('getValueString') + ->with('activity', $key, '') + ->willReturn('defaultAppValue'); + $this->appConfig + ->expects($this->once()) + ->method('getKeys') + ->willReturn([$key]); $this->listener->handle($this->event); } - public function dataForTestSettingUserDefaultsNotConfigured(): array { + public static function dataForTestSettingUserDefaultsNotConfigured(): array { return [ [ 'not_notify', diff --git a/tests/Listener/UserDeletedTest.php b/tests/Listener/UserDeletedTest.php index d235842d9..3e6c36455 100644 --- a/tests/Listener/UserDeletedTest.php +++ b/tests/Listener/UserDeletedTest.php @@ -33,45 +33,34 @@ use PHPUnit\Framework\TestCase; class UserDeletedTest extends TestCase { - /** - * @var Data|MockObject - */ - private $data; - - /** - * @var MailQueueHandler|MockObject - */ - private $mailQueueHandler; - - /** - * @var UserDeletedEvent - */ - private $event; - - /** - * @var UserDeleted - */ - private $listener; - - /** @var IUser|MockObject */ - private $user; + private Data&MockObject $data; + private MailQueueHandler&MockObject $mailQueueHandler; + private UserDeletedEvent $event; + private UserDeleted $listener; public const UID = 'myuser'; public function setUp(): void { parent::setUp(); + + $user = $this->createMock(IUser::class); + $user->expects($this->exactly(2))->method('getUID')->with()->willReturn(self::UID); + $this->data = $this->createMock(Data::class); $this->mailQueueHandler = $this->createMock(MailQueueHandler::class); - $this->user = $this->createMock(IUser::class); - $this->user->expects($this->exactly(2))->method('getUID')->with()->willReturn(self::UID); - $this->event = new UserDeletedEvent($this->user); + $this->event = new UserDeletedEvent($user); $this->listener = new UserDeleted($this->data, $this->mailQueueHandler); } public function testUserDeleted(): void { - $this->data->expects($this->once())->method('deleteActivities')->with(['affecteduser' => self::UID]); - $this->mailQueueHandler->expects($this->once())->method('purgeItemsForUser')->with(self::UID); + $this->data->expects($this->once()) + ->method('deleteActivities') + ->with(['affecteduser' => self::UID]); + $this->mailQueueHandler->expects($this->once()) + ->method('purgeItemsForUser') + ->with(self::UID); + $this->listener->handle($this->event); } } diff --git a/tests/MailQueueHandlerTest.php b/tests/MailQueueHandlerTest.php index e8e06dc31..97bac94d8 100644 --- a/tests/MailQueueHandlerTest.php +++ b/tests/MailQueueHandlerTest.php @@ -27,6 +27,7 @@ namespace OCA\Activity\Tests; use OC\Mail\Message; +use OCA\Activity\AppInfo\Application; use OCA\Activity\Data; use OCA\Activity\GroupHelper; use OCA\Activity\MailQueueHandler; @@ -35,65 +36,43 @@ use OCP\Activity\IManager; use OCP\IConfig; use OCP\IDateTimeFormatter; +use OCP\IDBConnection; use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Mail\IEMailTemplate; +use OCP\Mail\IEmailValidator; use OCP\Mail\IMailer; use OCP\RichObjectStrings\IValidator; +use OCP\Server; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; /** * Class MailQueueHandlerTest - * - * @group DB * @package OCA\Activity\Tests */ +#[Group('DB')] class MailQueueHandlerTest extends TestCase { - /** @var MailQueueHandler */ - protected $mailQueueHandler; - - /** @var MockObject|IMailer */ - protected $mailer; - - /** @var MockObject */ - protected $message; - - /** @var IUserManager */ - protected $oldUserManager; - - /** @var MockObject|IUserManager */ - protected $userManager; - - /** @var MockObject|IFactory */ - protected $lFactory; - - /** @var MockObject|IManager */ - protected $activityManager; - - /** @var IValidator|MockObject */ - protected $richObjectValidator; - - /** @var IConfig|MockObject */ - protected $config; - - /** @var LoggerInterface|MockObject */ - protected $logger; - - /** @var IDateTimeFormatter|MockObject */ - protected $dateTimeFormatter; - - /** @var MockObject|Data */ - protected Data $data; - - /** @var MockObject|GroupHelper */ - protected GroupHelper $groupHelper; - - /** @var MockObject|UserSettings */ - protected UserSettings $userSettings; + protected MailQueueHandler $mailQueueHandler; + protected IMailer&MockObject $mailer; + protected MockObject $message; + protected IUserManager&MockObject $userManager; + protected IFactory&MockObject $lFactory; + protected IManager&MockObject $activityManager; + protected IValidator&MockObject $richObjectValidator; + protected IConfig&MockObject $config; + protected MockObject&LoggerInterface $logger; + + protected IDateTimeFormatter&MockObject $dateTimeFormatter; + protected Data&MockObject $data; + protected GroupHelper&MockObject $groupHelper; + protected UserSettings&MockObject $userSettings; + protected IEmailValidator&MockObject $emailValidator; protected function setUp(): void { @@ -108,8 +87,9 @@ protected function setUp(): void { $this->data = $this->createMock(Data::class); $this->groupHelper = $this->createMock(GroupHelper::class); $this->userSettings = $this->createMock(UserSettings::class); + $this->emailValidator = $this->createMock(IEmailValidator::class); - $connection = \OC::$server->getDatabaseConnection(); + $connection = Server::get(IDBConnection::class); $query = $connection->prepare('INSERT INTO `*PREFIX*activity_mq` ' . ' (`amq_appid`, `amq_subject`, `amq_subjectparams`, `amq_affecteduser`, `amq_timestamp`, `amq_type`, `amq_latest_send`) ' . ' VALUES(?, ?, ?, ?, ?, ?, ?)'); @@ -122,47 +102,35 @@ protected function setUp(): void { $query->execute([$app, 'Test data', json_encode(['Param1']), 'user3', 150, 'phpunit', 155]); $event = $this->createMock(IEvent::class); - $event->expects($this->any()) - ->method('setApp') + $event->method('setApp') ->willReturnSelf(); - $event->expects($this->any()) - ->method('setType') + $event->method('setType') ->willReturnSelf(); - $event->expects($this->any()) - ->method('setAffectedUser') + $event->method('setAffectedUser') ->willReturnSelf(); - $event->expects($this->any()) - ->method('setTimestamp') + $event->method('setTimestamp') ->willReturnSelf(); - $event->expects($this->any()) - ->method('setSubject') + $event->method('setSubject') ->willReturnSelf(); - $event->expects($this->any()) - ->method('getIcon') + $event->method('getIcon') ->willReturn(''); - $event->expects($this->any()) - ->method('getParsedSubject') + $event->method('getParsedSubject') ->willReturn(''); - $event->expects($this->any()) - ->method('getRichSubject') + $event->method('getRichSubject') ->willReturn(''); - $event->expects($this->any()) - ->method('getRichSubjectParameters') + $event->method('getRichSubjectParameters') ->willReturn([]); $this->activityManager = $this->createMock(IManager::class); - $this->activityManager->expects($this->any()) - ->method('generateEvent') + $this->activityManager->method('generateEvent') ->willReturn($event); - $this->activityManager->expects($this->any()) - ->method('getProviders') + $this->activityManager->method('getProviders') ->willReturn([]); $this->message = $this->createMock(Message::class); $this->richObjectValidator = $this->createMock(IValidator::class); $this->mailer = $this->createMock(IMailer::class); - $this->mailer->expects($this->any()) - ->method('createMessage') + $this->mailer->method('createMessage') ->willReturn($this->message); $this->mailQueueHandler = new MailQueueHandler( $this->dateTimeFormatter, @@ -178,17 +146,19 @@ protected function setUp(): void { $this->data, $this->groupHelper, $this->userSettings, + $this->emailValidator, ); } protected function tearDown(): void { - $query = \OC::$server->getDatabaseConnection()->prepare('DELETE FROM `*PREFIX*activity_mq` WHERE `amq_timestamp` < 500'); + $query = Server::get(IDBConnection::class) + ->prepare('DELETE FROM `*PREFIX*activity_mq` WHERE `amq_timestamp` < 500'); $query->execute(); parent::tearDown(); } - public function getAffectedUsersData(): array { + public static function getAffectedUsersData(): array { return [ [null, ['user2', 'user1', 'user3'], []], [5, ['user2', 'user1', 'user3'], []], @@ -201,10 +171,11 @@ public function getAffectedUsersData(): array { /** * @dataProvider getAffectedUsersData * - * @param int $limit + * @param int|null $limit * @param array $affected * @param array $untouched */ + #[DataProvider('getAffectedUsersData')] public function testGetAffectedUsers(?int $limit, array $affected, array $untouched): void { $maxTime = 200; @@ -235,7 +206,7 @@ public function testGetItemsForUser(): void { $this->assertCount(2, $data, 'Failed to assert the user has 2 entries'); $this->assertSame(0, $skipped); - $connection = \OC::$server->getDatabaseConnection(); + $connection = Server::get(IDBConnection::class); $query = $connection->prepare('INSERT INTO `*PREFIX*activity_mq` ' . ' (`amq_appid`, `amq_subject`, `amq_subjectparams`, `amq_affecteduser`, `amq_timestamp`, `amq_type`, `amq_latest_send`) ' . ' VALUES(?, ?, ?, ?, ?, ?, ?)'); @@ -275,8 +246,8 @@ public function testSendEmailToUser(): void { $this->mailer->expects($this->once()) ->method('createEMailTemplate') ->willReturn($template); - $this->mailer->expects($this->once()) - ->method('validateMailAddress') + $this->emailValidator->expects($this->once()) + ->method('isValid') ->with($email) ->willReturn(true); @@ -297,10 +268,10 @@ public function testSendEmailToUser(): void { ->with($template); $userObject = $this->createMock(IUser::class); - $userObject->expects($this->any()) + $userObject ->method('getDisplayName') ->willReturn($userDisplayName); - $this->userManager->expects($this->any()) + $this->userManager ->method('get') ->willReturnMap([ [$user, $userObject], @@ -308,17 +279,13 @@ public function testSendEmailToUser(): void { ]); $this->lFactory->expects($this->once()) ->method('get') - ->with('activity', 'en') + ->with(Application::APP_ID, 'en') ->willReturn($this->getMockBuilder(IL10N::class)->getMock()); $this->activityManager->expects($this->exactly(2)) - ->method('setCurrentUserId') - ->withConsecutive( - [$user], - [null] - ); + ->method('setCurrentUserId'); - $this->dateTimeFormatter->expects($this->any()) + $this->dateTimeFormatter ->method('formatDateTimeRelativeDay') ->willReturn('relative'); diff --git a/tests/Mock/Setting1.php b/tests/Mock/Setting1.php index 8642b93d4..a992cae40 100644 --- a/tests/Mock/Setting1.php +++ b/tests/Mock/Setting1.php @@ -25,62 +25,35 @@ use OCP\Activity\ISetting; +/** + * @since 11.0.0 + */ class Setting1 implements ISetting { - /** - * @return string Lowercase a-z and underscore only identifier - * @since 11.0.0 - */ - public function getIdentifier() { + public function getIdentifier(): string { return 'type1'; } - /** - * @return string A translated string - * @since 11.0.0 - */ - public function getName() { + public function getName(): string { return 'type1'; } - /** - * @return int whether the filter should be rather on the top or bottom of - * the admin section. The filters are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. - * @since 11.0.0 - */ - public function getPriority() { + public function getPriority(): int { return 100; } - /** - * @return bool True when the option can be changed for the stream - * @since 11.0.0 - */ - public function canChangeStream() { + public function canChangeStream(): bool { return false; } - /** - * @return bool True when the option can be changed for the stream - * @since 11.0.0 - */ - public function isDefaultEnabledStream() { + public function isDefaultEnabledStream(): bool { return true; } - /** - * @return bool True when the option can be changed for the mail - * @since 11.0.0 - */ - public function canChangeMail() { + public function canChangeMail(): bool { return false; } - /** - * @return bool True when the option can be changed for the stream - * @since 11.0.0 - */ - public function isDefaultEnabledMail() { + public function isDefaultEnabledMail(): bool { return false; } } diff --git a/tests/Mock/Setting2.php b/tests/Mock/Setting2.php index 0cf0093bb..487c76669 100644 --- a/tests/Mock/Setting2.php +++ b/tests/Mock/Setting2.php @@ -25,62 +25,35 @@ use OCP\Activity\ISetting; +/** + * @since 11.0.0 + */ class Setting2 implements ISetting { - /** - * @return string Lowercase a-z and underscore only identifier - * @since 11.0.0 - */ - public function getIdentifier() { + public function getIdentifier(): string { return 'type2'; } - /** - * @return string A translated string - * @since 11.0.0 - */ - public function getName() { + public function getName(): string { return 'type2'; } - /** - * @return int whether the filter should be rather on the top or bottom of - * the admin section. The filters are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. - * @since 11.0.0 - */ - public function getPriority() { + public function getPriority(): int { return 100; } - /** - * @return bool True when the option can be changed for the stream - * @since 11.0.0 - */ - public function canChangeStream() { + public function canChangeStream(): bool { return false; } - /** - * @return bool True when the option can be changed for the stream - * @since 11.0.0 - */ - public function isDefaultEnabledStream() { + public function isDefaultEnabledStream(): bool { return true; } - /** - * @return bool True when the option can be changed for the mail - * @since 11.0.0 - */ - public function canChangeMail() { + public function canChangeMail(): bool { return false; } - /** - * @return bool True when the option can be changed for the stream - * @since 11.0.0 - */ - public function isDefaultEnabledMail() { + public function isDefaultEnabledMail(): bool { return true; } } diff --git a/tests/Template/RssTest.php b/tests/Template/RssTest.php index 7ed05e677..78b91e80a 100644 --- a/tests/Template/RssTest.php +++ b/tests/Template/RssTest.php @@ -26,23 +26,17 @@ use OCA\Activity\Tests\TestCase; use OCP\AppFramework\Http\TemplateResponse; +use PHPUnit\Framework\Attributes\DataProvider; class RssTest extends TestCase { - public function dataEmpty(): array { + public static function dataEmpty(): array { return [ ['de', 'http://localhost', 'title', 'description', 'Fri, 28 Aug 2015 11:47:14 +0000'], ['en', 'http://nextcloud.org', 'The title', 'Desc', 'Fri, 28 Aug 2015 11:47:15 +0000'], ]; } - /** - * @dataProvider dataEmpty - * - * @param string $language - * @param string $link - * @param string $description - * @param string $timeDate - */ + #[DataProvider('dataEmpty')] public function testEmpty(string $language, string $link, string $title, string $description, string $timeDate): void { $template = new TemplateResponse('activity', 'rss', [ 'rssLang' => $language, @@ -70,7 +64,7 @@ public function testEmpty(string $language, string $link, string $title, string ); } - public function dataContent(): array { + public static function dataContent(): array { return [ [[], ''], [ @@ -107,12 +101,7 @@ public function dataContent(): array { ]; } - /** - * @dataProvider dataContent - * - * @param array $activities - * @param string $expected - */ + #[DataProvider('dataContent')] public function testContent(array $activities, string $expected): void { $template = new TemplateResponse('activity', 'rss', [ 'rssLang' => 'en', diff --git a/tests/UserSettingsTest.php b/tests/UserSettingsTest.php index bf7b76fed..4c0d35310 100644 --- a/tests/UserSettingsTest.php +++ b/tests/UserSettingsTest.php @@ -28,16 +28,13 @@ use OCP\Activity\Exceptions\SettingNotFoundException; use OCP\Activity\IManager; use OCP\IConfig; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; class UserSettingsTest extends TestCase { - /** @var UserSettings */ - protected $userSettings; - - /** @var IManager|MockObject */ - protected $activityManager; - /** @var IConfig|MockObject */ - protected $config; + protected UserSettings $userSettings; + protected IManager&MockObject $activityManager; + protected IConfig&MockObject $config; protected function setUp(): void { parent::setUp(); @@ -46,7 +43,7 @@ protected function setUp(): void { $this->userSettings = new UserSettings($this->activityManager, $this->config); } - public function getDefaultSettingData(): array { + public static function getDefaultSettingData(): array { return [ ['email', 'type1', false], ['setting', 'batchtime', 3600], @@ -54,13 +51,7 @@ public function getDefaultSettingData(): array { ]; } - /** - * @dataProvider getDefaultSettingData - * - * @param string $method - * @param string $type - * @param mixed $expected - */ + #[DataProvider('getDefaultSettingData')] public function testGetDefaultSetting(string $method, string $type, $expected): void { if ($method !== 'setting') { if ($type === 'not-exists') { diff --git a/tests/ViewInfoCacheTest.php b/tests/ViewInfoCacheTest.php index 1c8e5122f..619ede4ca 100644 --- a/tests/ViewInfoCacheTest.php +++ b/tests/ViewInfoCacheTest.php @@ -28,26 +28,18 @@ use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; class ViewInfoCacheTest extends TestCase { - /** @var IRootFolder|MockObject */ - protected $rootFolder; - - /** @var ViewInfoCache|MockObject */ - protected $infoCache; + protected MockObject&IRootFolder $rootFolder; protected function setUp(): void { parent::setUp(); - $this->rootFolder = $this->createMock(IRootFolder::class); } - /** - * @param array $methods - * @return ViewInfoCache|MockObject - */ - public function getCache(array $methods = []): ViewInfoCache { + public function getCache(array $methods = []): ViewInfoCache|MockObject { if (empty($methods)) { return new ViewInfoCache( $this->rootFolder @@ -62,7 +54,7 @@ public function getCache(array $methods = []): ViewInfoCache { ->getMock(); } - public function dataGetInfoById(): array { + public static function dataGetInfoById(): array { return [ [ 'user', 23, 'path', [], true, 'findInfoById', @@ -118,17 +110,8 @@ public function dataGetInfoById(): array { ]; } - /** - * @dataProvider dataGetInfoById - * - * @param string $user - * @param int $id - * @param string $path - * @param array $cache - * @param bool $callsFind - * @param string $expected - */ - public function testGetInfoById(string $user, int $id, string $path, array $cache, bool $callsFind, $expected): void { + #[DataProvider('dataGetInfoById')] + public function testGetInfoById(string $user, int $id, string|array $path, array $cache, bool $callsFind, string|array $expected): void { $infoCache = $this->getCache([ 'findInfoById', ]); @@ -146,7 +129,7 @@ public function testGetInfoById(string $user, int $id, string $path, array $cach $this->assertSame($expected, $infoCache->getInfoById($user, $id, $path)); } - public function dataFindInfoById(): array { + public static function dataFindInfoById(): array { return [ [ 'user1', 23, '/test1', null, null, '/test1', false, @@ -246,23 +229,11 @@ public function dataFindInfoById(): array { ]; } - /** - * @dataProvider dataFindInfoById - * - * @param string $user - * @param int $fileId - * @param string $filename - * @param string|null $path - * @param string|null $pathTrash - * @param string $isDirPath - * @param bool $isDir - * @param array $expected - * @param array $expectedCache - */ + #[DataProvider('dataFindInfoById')] public function testFindInfoById(string $user, int $fileId, string $filename, ?string $path, ?string $pathTrash, string $isDirPath, bool $isDir, array $expected, array $expectedCache): void { $userFolder = $this->createMock(Folder::class); - $this->rootFolder->expects($this->any()) + $this->rootFolder ->method('getUserFolder') ->with($user) ->willReturn($userFolder); @@ -284,10 +255,10 @@ public function testFindInfoById(string $user, int $fileId, string $filename, ?s ->willThrowException(new NotFoundException()); } else { $node = $this->createMock($isDir ? Folder::class : File::class); - $node->expects($this->any()) + $node ->method('getPath') ->willReturn('/' . $user . '/files_trashbin' . $pathTrash); - $userTrashBin->expects($this->any()) + $userTrashBin ->method('getRelativePath') ->with('/' . $user . '/files_trashbin' . $pathTrash) ->willReturn($pathTrash); @@ -301,10 +272,10 @@ public function testFindInfoById(string $user, int $fileId, string $filename, ?s } } else { $node = $this->createMock($isDir ? Folder::class : File::class); - $node->expects($this->any()) + $node ->method('getPath') ->willReturn('/' . $user . '/files' . $path); - $userFolder->expects($this->any()) + $userFolder ->method('getRelativePath') ->with('/' . $user . '/files' . $path) ->willReturn($path); diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 9e76868b7..4a43eb232 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -1,28 +1,22 @@ - - + - - . - - - - - ../../activity/appinfo - ../../activity/lib - ../../activity/personal.php - - ../../activity/appinfo/update.php - - - - - - - + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" + cacheDirectory=".phpunit.cache"> + + . + + + + ../../activity/appinfo + ../../activity/lib + ../../activity/personal.php + + + ../../activity/appinfo/update.php + + - diff --git a/vendor-bin/cs-fixer/composer.json b/vendor-bin/cs-fixer/composer.json index dc5f19021..c3d7465e5 100644 --- a/vendor-bin/cs-fixer/composer.json +++ b/vendor-bin/cs-fixer/composer.json @@ -1,10 +1,10 @@ { "platform": { - "php": "8.1" + "php": "8.2" }, "sort-packages": true, "require-dev": { - "nextcloud/coding-standard": "^1.3", + "nextcloud/coding-standard": "^1.4.0", "friendsofphp/php-cs-fixer": "*" } } diff --git a/vendor-bin/cs-fixer/composer.lock b/vendor-bin/cs-fixer/composer.lock index 23a30f61d..af7b1cafe 100644 --- a/vendor-bin/cs-fixer/composer.lock +++ b/vendor-bin/cs-fixer/composer.lock @@ -4,31 +4,31 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2e6aed942d39c76cdb01df475132caab", + "content-hash": "f49dfe4c05a2d3fab76ee2332cfcf54e", "packages": [], "packages-dev": [ { "name": "kubawerlos/php-cs-fixer-custom-fixers", - "version": "v3.27.0", + "version": "v3.35.1", "source": { "type": "git", "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", - "reference": "d860473d16b906c7945206177edc7d112357a706" + "reference": "2a35f80ae24ca77443a7af1599c3a3db1b6bd395" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/d860473d16b906c7945206177edc7d112357a706", - "reference": "d860473d16b906c7945206177edc7d112357a706", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/2a35f80ae24ca77443a7af1599c3a3db1b6bd395", + "reference": "2a35f80ae24ca77443a7af1599c3a3db1b6bd395", "shasum": "" }, "require": { "ext-filter": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.61.1", + "friendsofphp/php-cs-fixer": "^3.87", "php": "^7.4 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.6.22 || 10.5.45 || ^11.5.7" + "phpunit/phpunit": "^9.6.24 || ^10.5.51 || ^11.5.32" }, "type": "library", "autoload": { @@ -49,7 +49,7 @@ "description": "A set of custom fixers for PHP CS Fixer", "support": { "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", - "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.27.0" + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.35.1" }, "funding": [ { @@ -57,7 +57,7 @@ "type": "github" } ], - "time": "2025-06-10T20:53:07+00:00" + "time": "2025-09-28T18:43:35+00:00" }, { "name": "nextcloud/coding-standard", @@ -106,16 +106,16 @@ }, { "name": "php-cs-fixer/shim", - "version": "v3.75.0", + "version": "v3.89.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "eea219a577085bd13ff0cb644a422c20798316c7" + "reference": "69182624902af6b2adafb30e2a092f0e6dd89fab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/eea219a577085bd13ff0cb644a422c20798316c7", - "reference": "eea219a577085bd13ff0cb644a422c20798316c7", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/69182624902af6b2adafb30e2a092f0e6dd89fab", + "reference": "69182624902af6b2adafb30e2a092f0e6dd89fab", "shasum": "" }, "require": { @@ -152,17 +152,17 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.75.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.89.1" }, - "time": "2025-03-31T18:45:02+00:00" + "time": "2025-10-24T12:05:38+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/vendor-bin/phpunit/composer.json b/vendor-bin/phpunit/composer.json index d1da27eb9..72ab22fd5 100644 --- a/vendor-bin/phpunit/composer.json +++ b/vendor-bin/phpunit/composer.json @@ -1,5 +1,9 @@ { + "platform": { + "php": "8.2" + }, + "sort-packages": true, "require-dev": { - "phpunit/phpunit": "^9" + "phpunit/phpunit": "^11.5.43" } } diff --git a/vendor-bin/phpunit/composer.lock b/vendor-bin/phpunit/composer.lock index 4a5c96d3b..784745509 100644 --- a/vendor-bin/phpunit/composer.lock +++ b/vendor-bin/phpunit/composer.lock @@ -4,91 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eaf427e91c04d06abdb542687ebc4d5d", + "content-hash": "c3493c8fffadc95cb5f8bec37a5bd082", "packages": [], "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -127,7 +57,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -135,20 +65,20 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", - "version": "v5.4.0", + "version": "v5.6.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + "reference": "3a454ca033b9e06b63282ce19562e892747449bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3a454ca033b9e06b63282ce19562e892747449bb", + "reference": "3a454ca033b9e06b63282ce19562e892747449bb", "shasum": "" }, "require": { @@ -167,7 +97,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -191,9 +121,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.2" }, - "time": "2024-12-30T11:07:19+00:00" + "time": "2025-10-21T19:32:17+00:00" }, { "name": "phar-io/manifest", @@ -315,35 +245,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "11.0.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "4f7722aa9a7b76aa775e2d9d4e95d1ea16eeeef4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4f7722aa9a7b76aa775e2d9d4e95d1ea16eeeef4", + "reference": "4f7722aa9a7b76aa775e2d9d4e95d1ea16eeeef4", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", + "nikic/php-parser": "^5.4.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.0", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^11.5.2" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -352,7 +282,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-main": "11.0.x-dev" } }, "autoload": { @@ -381,40 +311,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.11" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2025-08-27T14:37:49+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -441,7 +383,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" }, "funding": [ { @@ -449,28 +392,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2024-08-27T05:02:59+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-pcntl": "*" @@ -478,7 +421,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -504,7 +447,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" }, "funding": [ { @@ -512,32 +456,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2024-07-03T05:07:44+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -563,7 +507,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" }, "funding": [ { @@ -571,32 +516,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2024-07-03T05:08:43+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -622,7 +567,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" }, "funding": [ { @@ -630,54 +576,52 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2024-07-03T05:09:35+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "11.5.43", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "c6b89b6cf4324a8b4cb86e1f5dfdd6c9e0371924" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c6b89b6cf4324a8b4cb86e1f5dfdd6c9e0371924", + "reference": "c6b89b6cf4324a8b4cb86e1f5dfdd6c9e0371924", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.11", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.3", + "sebastian/comparator": "^6.3.2", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.1", + "sebastian/exporter": "^6.3.2", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/type": "^5.1.3", + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -685,7 +629,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "11.5-dev" } }, "autoload": { @@ -717,7 +661,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.43" }, "funding": [ { @@ -728,37 +672,45 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2025-10-30T08:39:39+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.2", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -781,7 +733,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" }, "funding": [ { @@ -789,32 +742,32 @@ "type": "github" } ], - "time": "2024-03-02T06:27:43+00:00" + "time": "2024-07-03T04:41:36+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -837,7 +790,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" }, "funding": [ { @@ -845,32 +799,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2025-03-19T07:56:08+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -892,7 +846,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" }, "funding": [ { @@ -900,34 +855,39 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2024-07-03T04:45:54+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "6.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85c77556683e6eee4323e4c5468641ca0237e2e8", + "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.4" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.3-dev" } }, "autoload": { @@ -966,41 +926,54 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2025-08-10T08:07:46+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1023,7 +996,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" }, "funding": [ { @@ -1031,33 +1005,33 @@ "type": "github" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2024-07-03T04:49:50+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^11.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1089,7 +1063,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -1097,27 +1072,27 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "7.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/a5c75038693ad2e8d4b6c15ba2403532647830c4", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.3" }, "suggest": { "ext-posix": "*" @@ -1125,7 +1100,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "7.2-dev" } }, "autoload": { @@ -1144,7 +1119,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -1152,42 +1127,55 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2025-05-21T11:55:47+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "6.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.3-dev" } }, "autoload": { @@ -1229,46 +1217,56 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2025-09-24T06:12:51+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1287,13 +1285,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" }, "funding": [ { @@ -1301,33 +1300,33 @@ "type": "github" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2024-07-03T04:57:36+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1350,7 +1349,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" }, "funding": [ { @@ -1358,34 +1358,34 @@ "type": "github" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2024-07-03T04:58:38+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1407,7 +1407,8 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" }, "funding": [ { @@ -1415,32 +1416,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2024-07-03T05:00:13+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1462,7 +1463,8 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" }, "funding": [ { @@ -1470,32 +1472,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2024-07-03T05:01:32+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "6.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1525,40 +1527,53 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2025-08-13T04:42:22+00:00" }, { - "name": "sebastian/resource-operations", - "version": "3.0.4", + "name": "sebastian/type", + "version": "5.1.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -1573,46 +1588,58 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" } ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2025-08-09T06:55:48+00:00" }, { - "name": "sebastian/type", - "version": "3.2.1", + "name": "sebastian/version", + "version": "5.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" + "php": ">=8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1631,11 +1658,12 @@ "role": "lead" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" }, "funding": [ { @@ -1643,60 +1671,59 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2024-10-09T05:16:32+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "staabm/side-effects-detector", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", "shasum": "" }, "require": { - "php": ">=7.3" + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" }, + "type": "library", "autoload": { "classmap": [ - "src/" + "lib/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/staabm", "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2024-10-20T05:08:20+00:00" }, { "name": "theseer/tokenizer", diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index aeb715cd5..8a038cc48 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,11 +1,11 @@ { "require-dev": { "nextcloud/ocp": "dev-master", - "vimeo/psalm": "^6.12" + "vimeo/psalm": "^6.13.1" }, "config": { "platform": { - "php": "8.1.32" + "php": "8.2.27" }, "sort-packages": true } diff --git a/vendor-bin/psalm/composer.lock b/vendor-bin/psalm/composer.lock index 4a599dbd6..cb482902b 100644 --- a/vendor-bin/psalm/composer.lock +++ b/vendor-bin/psalm/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c31c4a0d365e0bfbe58854c54f953707", + "content-hash": "cde3b0c29180ef545e96e92711568116", "packages": [], "packages-dev": [ { "name": "amphp/amp", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "7cf7fef3d667bfe4b2560bc87e67d5387a7bcde9" + "reference": "fa0ab33a6f47a82929c38d03ca47ebb71086a93f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/7cf7fef3d667bfe4b2560bc87e67d5387a7bcde9", - "reference": "7cf7fef3d667bfe4b2560bc87e67d5387a7bcde9", + "url": "https://api.github.com/repos/amphp/amp/zipball/fa0ab33a6f47a82929c38d03ca47ebb71086a93f", + "reference": "fa0ab33a6f47a82929c38d03ca47ebb71086a93f", "shasum": "" }, "require": { @@ -78,7 +78,7 @@ ], "support": { "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v3.1.0" + "source": "https://github.com/amphp/amp/tree/v3.1.1" }, "funding": [ { @@ -86,7 +86,7 @@ "type": "github" } ], - "time": "2025-01-26T16:07:39+00:00" + "time": "2025-08-27T21:42:00+00:00" }, { "name": "amphp/byte-stream", @@ -319,16 +319,16 @@ }, { "name": "amphp/parallel", - "version": "v2.3.1", + "version": "v2.3.2", "source": { "type": "git", "url": "https://github.com/amphp/parallel.git", - "reference": "5113111de02796a782f5d90767455e7391cca190" + "reference": "321b45ae771d9c33a068186b24117e3cd1c48dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/parallel/zipball/5113111de02796a782f5d90767455e7391cca190", - "reference": "5113111de02796a782f5d90767455e7391cca190", + "url": "https://api.github.com/repos/amphp/parallel/zipball/321b45ae771d9c33a068186b24117e3cd1c48dce", + "reference": "321b45ae771d9c33a068186b24117e3cd1c48dce", "shasum": "" }, "require": { @@ -391,7 +391,7 @@ ], "support": { "issues": "https://github.com/amphp/parallel/issues", - "source": "https://github.com/amphp/parallel/tree/v2.3.1" + "source": "https://github.com/amphp/parallel/tree/v2.3.2" }, "funding": [ { @@ -399,7 +399,7 @@ "type": "github" } ], - "time": "2024-12-21T01:56:09+00:00" + "time": "2025-08-27T21:55:40+00:00" }, { "name": "amphp/parser", @@ -896,16 +896,16 @@ }, { "name": "composer/semver", - "version": "3.4.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { @@ -957,7 +957,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" + "source": "https://github.com/composer/semver/tree/3.4.4" }, "funding": [ { @@ -967,13 +967,9 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2024-09-19T14:15:21+00:00" + "time": "2025-08-20T19:15:30+00:00" }, { "name": "composer/xdebug-handler", @@ -1280,16 +1276,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "8520451a140d3f46ac33042715115e290cf5785f" + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", - "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", "shasum": "" }, "require": { @@ -1299,10 +1295,10 @@ "fidry/makefile": "^0.2.0", "fidry/php-cs-fixer-config": "^1.1.2", "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^8.5.31 || ^9.5.26", "webmozarts/strict-phpunit": "^7.5" }, @@ -1329,7 +1325,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" }, "funding": [ { @@ -1337,7 +1333,7 @@ "type": "github" } ], - "time": "2024-08-06T10:04:20+00:00" + "time": "2025-08-14T07:29:31+00:00" }, { "name": "kelunik/certificate", @@ -1628,12 +1624,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "fb418a70943a4e4a64ade1ee025019e72d87b694" + "reference": "bc6cd08b280bd4be8ae64faaed057ca2a18bdf6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/fb418a70943a4e4a64ade1ee025019e72d87b694", - "reference": "fb418a70943a4e4a64ade1ee025019e72d87b694", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/bc6cd08b280bd4be8ae64faaed057ca2a18bdf6d", + "reference": "bc6cd08b280bd4be8ae64faaed057ca2a18bdf6d", "shasum": "" }, "require": { @@ -1647,7 +1643,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "32.0.0-dev" + "dev-master": "33.0.0-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -1669,20 +1665,20 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2025-07-08T00:54:05+00:00" + "time": "2025-11-04T00:51:09+00:00" }, { "name": "nikic/php-parser", - "version": "v5.6.0", + "version": "v5.6.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "221b0d0fdf1369c71047ad1d18bb5880017bbc56" + "reference": "3a454ca033b9e06b63282ce19562e892747449bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/221b0d0fdf1369c71047ad1d18bb5880017bbc56", - "reference": "221b0d0fdf1369c71047ad1d18bb5880017bbc56", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3a454ca033b9e06b63282ce19562e892747449bb", + "reference": "3a454ca033b9e06b63282ce19562e892747449bb", "shasum": "" }, "require": { @@ -1701,7 +1697,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -1725,9 +1721,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.2" }, - "time": "2025-07-27T20:03:57+00:00" + "time": "2025-10-21T19:32:17+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1784,16 +1780,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.2", + "version": "5.6.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" + "reference": "94f8051919d1b0369a6bcc7931d679a511c03fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94f8051919d1b0369a6bcc7931d679a511c03fe9", + "reference": "94f8051919d1b0369a6bcc7931d679a511c03fe9", "shasum": "" }, "require": { @@ -1842,9 +1838,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.3" }, - "time": "2025-04-13T19:20:35+00:00" + "time": "2025-08-01T19:43:32+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1906,16 +1902,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", "shasum": "" }, "require": { @@ -1947,9 +1943,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.2.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" }, - "time": "2025-07-13T07:04:09+00:00" + "time": "2025-08-30T15:50:23+00:00" }, { "name": "psr/clock", @@ -2334,29 +2330,29 @@ }, { "name": "sebastian/diff", - "version": "5.1.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", - "symfony/process": "^6.4" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2389,7 +2385,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -2397,7 +2393,7 @@ "type": "github" } ], - "time": "2024-03-02T07:15:17+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "spatie/array-to-xml", @@ -2469,47 +2465,47 @@ }, { "name": "symfony/console", - "version": "v6.4.24", + "version": "v7.3.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "59266a5bf6a596e3e0844fd95e6ad7ea3c1d3350" + "reference": "cdb80fa5869653c83cfe1a9084a673b6daf57ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/59266a5bf6a596e3e0844fd95e6ad7ea3c1d3350", - "reference": "59266a5bf6a596e3e0844fd95e6ad7ea3c1d3350", + "url": "https://api.github.com/repos/symfony/console/zipball/cdb80fa5869653c83cfe1a9084a673b6daf57ea7", + "reference": "cdb80fa5869653c83cfe1a9084a673b6daf57ea7", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^7.2" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2543,7 +2539,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.24" + "source": "https://github.com/symfony/console/tree/v7.3.5" }, "funding": [ { @@ -2563,7 +2559,7 @@ "type": "tidelift" } ], - "time": "2025-07-30T10:38:54+00:00" + "time": "2025-10-14T15:46:26+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2634,25 +2630,25 @@ }, { "name": "symfony/filesystem", - "version": "v6.4.24", + "version": "v7.3.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "75ae2edb7cdcc0c53766c30b0a2512b8df574bd8" + "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/75ae2edb7cdcc0c53766c30b0a2512b8df574bd8", - "reference": "75ae2edb7cdcc0c53766c30b0a2512b8df574bd8", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edcbb768a186b5c3f25d0643159a787d3e63b7fd", + "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^5.4|^6.4|^7.0" + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2680,7 +2676,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.24" + "source": "https://github.com/symfony/filesystem/tree/v7.3.2" }, "funding": [ { @@ -2700,11 +2696,11 @@ "type": "tidelift" } ], - "time": "2025-07-10T08:14:14+00:00" + "time": "2025-07-07T08:17:47+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2763,7 +2759,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" }, "funding": [ { @@ -2774,6 +2770,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -2783,16 +2783,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", "shasum": "" }, "require": { @@ -2841,7 +2841,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" }, "funding": [ { @@ -2852,16 +2852,20 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-06-27T09:58:17+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -2922,7 +2926,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, "funding": [ { @@ -2933,6 +2937,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -2942,7 +2950,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -3003,7 +3011,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" }, "funding": [ { @@ -3014,6 +3022,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -3023,16 +3035,16 @@ }, { "name": "symfony/polyfill-php84", - "version": "v1.32.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "000df7860439609837bbe28670b0be15783b7fbf" + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/000df7860439609837bbe28670b0be15783b7fbf", - "reference": "000df7860439609837bbe28670b0be15783b7fbf", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", "shasum": "" }, "require": { @@ -3079,7 +3091,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" }, "funding": [ { @@ -3090,12 +3102,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-02-20T12:04:08+00:00" + "time": "2025-06-24T13:30:11+00:00" }, { "name": "symfony/service-contracts", @@ -3182,20 +3198,20 @@ }, { "name": "symfony/string", - "version": "v6.4.24", + "version": "v7.3.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4" + "reference": "f96476035142921000338bad71e5247fbc138872" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f0ce0bd36a3accb4a225435be077b4b4875587f4", - "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4", + "url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872", + "reference": "f96476035142921000338bad71e5247fbc138872", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -3205,11 +3221,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", + "symfony/emoji": "^7.1", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3248,7 +3264,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.24" + "source": "https://github.com/symfony/string/tree/v7.3.4" }, "funding": [ { @@ -3268,7 +3284,7 @@ "type": "tidelift" } ], - "time": "2025-07-10T08:14:14+00:00" + "time": "2025-09-11T14:36:48+00:00" }, { "name": "vimeo/psalm", @@ -3390,28 +3406,28 @@ }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -3442,9 +3458,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-29T15:56:20+00:00" } ], "aliases": [], @@ -3457,7 +3473,7 @@ "platform": {}, "platform-dev": {}, "platform-overrides": { - "php": "8.1.32" + "php": "8.2.27" }, "plugin-api-version": "2.6.0" }