From 07c614d2bdb28a691634d7ff78dc8bc6b5c79039 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 20 Feb 2026 21:47:21 -0500 Subject: [PATCH 1/2] test(user-picker): fix PHPUnit 12 dataprovider deprecations Eliminates PHPUnit deprecation notices (due to @dataProvider use) that were introduced via #57539. Signed-off-by: Josh --- .../Reference/ProfilePickerReferenceProviderTest.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php b/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php index d3cf072b36c40..d6fdebc51aeb4 100644 --- a/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php +++ b/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php @@ -273,9 +273,8 @@ private function setupUserAccountReferenceExpectation(string $userId): ?IReferen /** * Resolved reference should contain the expected reference fields according to account property scope - * - * @dataProvider resolveReferenceDataProvider */ + #[DataProvider('resolveReferenceDataProvider')] public function testResolveReference($expected, $reference, $userId) { if (isset($userId)) { $expectedReference = $this->setupUserAccountReferenceExpectation($userId); @@ -291,15 +290,15 @@ public function testGetId() { } /** - * @dataProvider referenceDataProvider */ + #[DataProvider('referenceDataProvider')] public function testMatchReference($expected, $reference) { $this->assertEquals($expected, $this->referenceProvider->matchReference($reference)); } /** - * @dataProvider cacheKeyDataProvider */ + #[DataProvider('cacheKeyDataProvider')] public function testGetCacheKey($expected, $reference) { $this->assertEquals($expected, $this->referenceProvider->getCacheKey($reference)); } @@ -319,16 +318,15 @@ public function testGetTitle() { /** * Test getObjectId method. * It should return the userid extracted from the link (http(s)://domain.com/(index.php)/u/{userid}). - * - * @dataProvider objectIdDataProvider */ + #[DataProvider('objectIdDataProvider')] public function testGetObjectId($expected, $reference) { $this->assertEquals($expected, $this->referenceProvider->getObjectId($reference)); } /** - * @dataProvider locationDataProvider */ + #[DataProvider('locationDataProvider')] public function testGetOpenStreetLocationUrl($expected, $location) { $this->assertEquals($expected, $this->referenceProvider->getOpenStreetLocationUrl($location)); } From 24ffcd74f1838a2592d1114c2ec58662eba7c387 Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 21 Feb 2026 12:58:22 -0500 Subject: [PATCH 2/2] test(user-picker): add DataProvider use statement Signed-off-by: Josh --- .../tests/unit/Reference/ProfilePickerReferenceProviderTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php b/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php index d6fdebc51aeb4..6de2b50360f68 100644 --- a/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php +++ b/apps/user_picker/tests/unit/Reference/ProfilePickerReferenceProviderTest.php @@ -17,6 +17,7 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Profile\IProfileManager; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; class ProfilePickerReferenceProviderTest extends \Test\TestCase {