diff --git a/tests/src/Kernel/Normalizer/PrimaryEntityReferenceItemNormalizerTest.php b/tests/src/Kernel/Normalizer/PrimaryEntityReferenceItemNormalizerTest.php
index b1e25e5..1626aac 100644
--- a/tests/src/Kernel/Normalizer/PrimaryEntityReferenceItemNormalizerTest.php
+++ b/tests/src/Kernel/Normalizer/PrimaryEntityReferenceItemNormalizerTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Kernel\Normalizer;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\entity_test\Entity\EntityTestMul;
 use Drupal\field\Entity\FieldConfig;
@@ -17,6 +19,8 @@ use Drupal\primary_entity_reference\Plugin\Field\FieldType\PrimaryEntityReferenc
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Normalizer\PrimaryEntityReferenceItemNormalizer
  */
+#[Group('primary_entity_reference')]
+#[RunTestsInSeparateProcesses]
 class PrimaryEntityReferenceItemNormalizerTest extends KernelTestBase {
 
   /**
diff --git a/tests/src/Kernel/Recipe/RecipeIntegrationTest.php b/tests/src/Kernel/Recipe/RecipeIntegrationTest.php
index 6e3fe43..60f5931 100644
--- a/tests/src/Kernel/Recipe/RecipeIntegrationTest.php
+++ b/tests/src/Kernel/Recipe/RecipeIntegrationTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Kernel\Recipe;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\entity_test\Entity\EntityTestMul;
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\field\Entity\FieldConfig;
@@ -18,6 +20,8 @@ use Drupal\KernelTests\KernelTestBase;
  *
  * @group primary_entity_reference
  */
+#[Group('primary_entity_reference')]
+#[RunTestsInSeparateProcesses]
 class RecipeIntegrationTest extends KernelTestBase {
 
   /**
diff --git a/tests/src/Kernel/Views/HookDiscoveryTest.php b/tests/src/Kernel/Views/HookDiscoveryTest.php
index 2325b0c..d2d7203 100644
--- a/tests/src/Kernel/Views/HookDiscoveryTest.php
+++ b/tests/src/Kernel/Views/HookDiscoveryTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Kernel\Views;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\primary_entity_reference\Hook\PrimaryEntityReferenceViewsHooks;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
@@ -15,6 +17,8 @@ use Drupal\views\Views;
  *
  * @group primary_entity_reference
  */
+#[Group('primary_entity_reference')]
+#[RunTestsInSeparateProcesses]
 class HookDiscoveryTest extends KernelTestBase {
 
   /**
diff --git a/tests/src/Kernel/Views/PrimaryEntityReferenceViewsTest.php b/tests/src/Kernel/Views/PrimaryEntityReferenceViewsTest.php
index 3f5ce59..6658c43 100644
--- a/tests/src/Kernel/Views/PrimaryEntityReferenceViewsTest.php
+++ b/tests/src/Kernel/Views/PrimaryEntityReferenceViewsTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Kernel\Views;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\primary_entity_reference\Hook\PrimaryEntityReferenceViewsHooks;
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\entity_test\Entity\EntityTestMul;
@@ -18,6 +20,8 @@ use Drupal\views\Views;
  *
  * @group primary_entity_reference
  */
+#[Group('primary_entity_reference')]
+#[RunTestsInSeparateProcesses]
 class PrimaryEntityReferenceViewsTest extends ViewsKernelTestBase {
 
   /**
diff --git a/tests/src/Unit/Hook/PrimaryEntityReferenceFormatterHooksTest.php b/tests/src/Unit/Hook/PrimaryEntityReferenceFormatterHooksTest.php
index 23a9a16..25aff6a 100644
--- a/tests/src/Unit/Hook/PrimaryEntityReferenceFormatterHooksTest.php
+++ b/tests/src/Unit/Hook/PrimaryEntityReferenceFormatterHooksTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Hook;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\primary_entity_reference\Hook\PrimaryEntityReferenceFormatterHooks;
 use Drupal\Tests\UnitTestCase;
 
@@ -13,6 +14,7 @@ use Drupal\Tests\UnitTestCase;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Hook\PrimaryEntityReferenceFormatterHooks
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceFormatterHooksTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Hook/PrimaryEntityReferenceTokenHooksTest.php b/tests/src/Unit/Hook/PrimaryEntityReferenceTokenHooksTest.php
index bb0c3c4..8dfa48b 100644
--- a/tests/src/Unit/Hook/PrimaryEntityReferenceTokenHooksTest.php
+++ b/tests/src/Unit/Hook/PrimaryEntityReferenceTokenHooksTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Hook;
 
+use PHPUnit\Framework\Attributes\Group;
 use PHPUnit\Framework\MockObject\MockObject;
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Entity\EntityFieldManagerInterface;
@@ -25,6 +26,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Hook\PrimaryEntityReferenceTokenHooks
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceTokenHooksTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Hook/PrimaryEntityReferenceViewsHooksTest.php b/tests/src/Unit/Hook/PrimaryEntityReferenceViewsHooksTest.php
index ff8353e..3e608c1 100644
--- a/tests/src/Unit/Hook/PrimaryEntityReferenceViewsHooksTest.php
+++ b/tests/src/Unit/Hook/PrimaryEntityReferenceViewsHooksTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Hook;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\Entity\EntityFieldManagerInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\field\FieldStorageConfigInterface;
@@ -17,6 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Hook\PrimaryEntityReferenceViewsHooks
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceViewsHooksTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceIdFormatterTest.php b/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceIdFormatterTest.php
index a7d7ae7..38f3d14 100644
--- a/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceIdFormatterTest.php
+++ b/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceIdFormatterTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field\FieldFormatter;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -20,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\FieldFormatter\PrimaryEntityReferenceIdFormatter
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceIdFormatterTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceLabelFormatterTest.php b/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceLabelFormatterTest.php
index 19aa28c..e3ca853 100644
--- a/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceLabelFormatterTest.php
+++ b/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceLabelFormatterTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field\FieldFormatter;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -20,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\FieldFormatter\PrimaryEntityReferenceLabelFormatter
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceLabelFormatterTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceRenderedEntityFormatterTest.php b/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceRenderedEntityFormatterTest.php
index 55939d2..19e9d6d 100644
--- a/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceRenderedEntityFormatterTest.php
+++ b/tests/src/Unit/Plugin/Field/FieldFormatter/PrimaryEntityReferenceRenderedEntityFormatterTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field\FieldFormatter;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
@@ -22,6 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\FieldFormatter\PrimaryEntityReferenceRenderedEntityFormatter
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceRenderedEntityFormatterTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Plugin/Field/FieldType/PrimaryEntityReferenceItemTest.php b/tests/src/Unit/Plugin/Field/FieldType/PrimaryEntityReferenceItemTest.php
index 125f33e..cbe37d9 100644
--- a/tests/src/Unit/Plugin/Field/FieldType/PrimaryEntityReferenceItemTest.php
+++ b/tests/src/Unit/Plugin/Field/FieldType/PrimaryEntityReferenceItemTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field\FieldType;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\primary_entity_reference\Plugin\Field\FieldType\PrimaryEntityReferenceItem;
@@ -14,6 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\FieldType\PrimaryEntityReferenceItem
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceItemTest extends UnitTestCase {
 
 
diff --git a/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceInlineFormWidgetTest.php b/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceInlineFormWidgetTest.php
index 6bc2651..72a4268 100644
--- a/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceInlineFormWidgetTest.php
+++ b/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceInlineFormWidgetTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field\FieldWidget;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Drupal\primary_entity_reference\Plugin\Field\FieldWidget\PrimaryEntityReferenceInlineFormWidget;
 use Drupal\Core\Field\FieldDefinitionInterface;
@@ -28,6 +29,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\FieldWidget\PrimaryEntityReferenceInlineFormWidget
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceInlineFormWidgetTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceOptionsButtonsWidgetTest.php b/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceOptionsButtonsWidgetTest.php
index 838992a..df09335 100644
--- a/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceOptionsButtonsWidgetTest.php
+++ b/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryEntityReferenceOptionsButtonsWidgetTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field\FieldWidget;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\Entity\EntityFormInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Form\FormStateInterface;
@@ -17,6 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\FieldWidget\PrimaryEntityReferenceOptionsButtonsWidget
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceOptionsButtonsWidgetTest extends UnitTestCase {
 
   /**
@@ -63,12 +65,10 @@ class PrimaryEntityReferenceOptionsButtonsWidgetTest extends UnitTestCase {
 
     // Set the column property used by parent massageFormValues.
     $columnProperty = $reflection->getProperty('column');
-    $columnProperty->setAccessible(TRUE);
     $columnProperty->setValue($widget, 'target_id');
 
     // Set the settings property to avoid getSetting() errors.
     $settingsProperty = $reflection->getParentClass()->getProperty('settings');
-    $settingsProperty->setAccessible(TRUE);
     $settingsProperty->setValue($widget, [
       'primary_label'     => 'Primary',
       'show_primary_only' => FALSE,
@@ -221,7 +221,6 @@ class PrimaryEntityReferenceOptionsButtonsWidgetTest extends UnitTestCase {
     // We need to use reflection to call settingsForm since widget is mocked.
     $reflection = new \ReflectionClass($widget);
     $method = $reflection->getMethod('settingsForm');
-    $method->setAccessible(TRUE);
 
     $element = $method->invoke($widget, $form, $form_state);
 
@@ -242,14 +241,12 @@ class PrimaryEntityReferenceOptionsButtonsWidgetTest extends UnitTestCase {
     // Set show_primary_only to TRUE via reflection.
     $reflection = new \ReflectionClass($widget);
     $settingsProperty = $reflection->getParentClass()->getProperty('settings');
-    $settingsProperty->setAccessible(TRUE);
     $settingsProperty->setValue($widget, [
       'primary_label'     => 'Primary',
       'show_primary_only' => TRUE,
     ]);
 
     $method = $reflection->getMethod('settingsSummary');
-    $method->setAccessible(TRUE);
 
     $summary = $method->invoke($widget);
 
@@ -282,12 +279,10 @@ class PrimaryEntityReferenceOptionsButtonsWidgetTest extends UnitTestCase {
     // Set required properties.
     $reflection = new \ReflectionClass($widget);
     $columnProperty = $reflection->getProperty('column');
-    $columnProperty->setAccessible(TRUE);
     $columnProperty->setValue($widget, 'target_id');
 
     // Set fieldDefinition property.
     $fieldDefinitionProperty = $reflection->getProperty('fieldDefinition');
-    $fieldDefinitionProperty->setAccessible(TRUE);
 
     $field_definition = $this->createMock('Drupal\Core\Field\FieldDefinitionInterface');
     $field_definition->expects($this->any())
@@ -297,7 +292,6 @@ class PrimaryEntityReferenceOptionsButtonsWidgetTest extends UnitTestCase {
 
     // Set settings to enable show_primary_only.
     $settingsProperty = $reflection->getParentClass()->getProperty('settings');
-    $settingsProperty->setAccessible(TRUE);
     $settingsProperty->setValue($widget, [
       'primary_label'     => 'Primary',
       'show_primary_only' => TRUE,
diff --git a/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryReferenceAutocompleteWidgetTest.php b/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryReferenceAutocompleteWidgetTest.php
index 8f50107..896b8d4 100644
--- a/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryReferenceAutocompleteWidgetTest.php
+++ b/tests/src/Unit/Plugin/Field/FieldWidget/PrimaryReferenceAutocompleteWidgetTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field\FieldWidget;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
@@ -20,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\FieldWidget\PrimaryReferenceAutocompleteWidget
  */
+#[Group('primary_entity_reference')]
 class PrimaryReferenceAutocompleteWidgetTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/Plugin/Field/PrimaryEntityReferenceFieldItemListTest.php b/tests/src/Unit/Plugin/Field/PrimaryEntityReferenceFieldItemListTest.php
index f49b662..a5986b6 100644
--- a/tests/src/Unit/Plugin/Field/PrimaryEntityReferenceFieldItemListTest.php
+++ b/tests/src/Unit/Plugin/Field/PrimaryEntityReferenceFieldItemListTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\Plugin\Field;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\primary_entity_reference\Plugin\Field\PrimaryEntityReferenceFieldItemList;
 use Drupal\Tests\UnitTestCase;
@@ -15,6 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  * @group primary_entity_reference
  * @coversDefaultClass \Drupal\primary_entity_reference\Plugin\Field\PrimaryEntityReferenceFieldItemList
  */
+#[Group('primary_entity_reference')]
 class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
 
   /**
@@ -69,7 +71,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item]);
 
     // Call the real __get method by using a real instance with the list set.
@@ -133,7 +134,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item1, $item2, $item3]);
 
     $result = $itemList->primary();
@@ -175,7 +175,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item1, $item2]);
 
     $result = $itemList->primary();
@@ -199,7 +198,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, []);
 
     $result = $itemList->primary();
@@ -266,7 +264,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item1, $item2, $item3]);
 
     // Call preSave.
@@ -320,7 +317,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item1, $item2]);
 
     // Call preSave.
@@ -380,7 +376,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item1, $item2]);
 
     // Call preSave.
@@ -440,7 +435,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item1, $item2]);
 
     // Call preSave.
@@ -515,7 +509,6 @@ class PrimaryEntityReferenceFieldItemListTest extends UnitTestCase {
     // Use reflection to set the protected list property.
     $reflection = new \ReflectionClass(PrimaryEntityReferenceFieldItemList::class);
     $listProperty = $reflection->getProperty('list');
-    $listProperty->setAccessible(TRUE);
     $listProperty->setValue($itemList, [$item1, $item2, $item3]);
 
     // Call preSave.
diff --git a/tests/src/Unit/PostUpdate/AddButtonPrimaryLabelSettingPostUpdateTest.php b/tests/src/Unit/PostUpdate/AddButtonPrimaryLabelSettingPostUpdateTest.php
index 1559346..0d8c1cb 100644
--- a/tests/src/Unit/PostUpdate/AddButtonPrimaryLabelSettingPostUpdateTest.php
+++ b/tests/src/Unit/PostUpdate/AddButtonPrimaryLabelSettingPostUpdateTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\PostUpdate;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -14,6 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  *
  * @group primary_entity_reference
  */
+#[Group('primary_entity_reference')]
 class AddButtonPrimaryLabelSettingPostUpdateTest extends UnitTestCase {
 
   /**
diff --git a/tests/src/Unit/PostUpdate/AddShowPrimaryOnlySettingPostUpdateTest.php b/tests/src/Unit/PostUpdate/AddShowPrimaryOnlySettingPostUpdateTest.php
index f149593..c2b4b25 100644
--- a/tests/src/Unit/PostUpdate/AddShowPrimaryOnlySettingPostUpdateTest.php
+++ b/tests/src/Unit/PostUpdate/AddShowPrimaryOnlySettingPostUpdateTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\primary_entity_reference\Unit\PostUpdate;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Tests\UnitTestCase;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 
@@ -12,6 +13,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
  *
  * @group primary_entity_reference
  */
+#[Group('primary_entity_reference')]
 class AddShowPrimaryOnlySettingPostUpdateTest extends UnitTestCase {
 
   /**
