diff --git a/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php b/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php
index 083def830f828d8e8777b7ff5b639442d5f93462..a1fb1d959ca341480e8e2c6e039fe319d8f48c75 100644
--- a/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php
+++ b/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php
@@ -95,7 +95,6 @@ abstract class PackageManagerKernelTestBase extends KernelTestBase {
    * The Symfony filesystem class.
    *
    * @var \Symfony\Component\Filesystem\Filesystem
-   * @phpstan-ignore-next-line
    */
   private readonly Filesystem $fileSystem;
 
@@ -105,7 +104,6 @@ abstract class PackageManagerKernelTestBase extends KernelTestBase {
    * @var \ColinODell\PsrTestLogger\TestLogger
    *
    * @see ::tearDown()
-   * @phpstan-ignore-next-line
    */
   protected readonly TestLogger $failureLogger;
 
diff --git a/package_manager/tests/src/Unit/PathLocatorTest.php b/package_manager/tests/src/Unit/PathLocatorTest.php
index 0cafee88e0424e345058f8ece67a207d825db935..6a1ec8c9edd7011c94b54983198f2982d180eeca 100644
--- a/package_manager/tests/src/Unit/PathLocatorTest.php
+++ b/package_manager/tests/src/Unit/PathLocatorTest.php
@@ -108,7 +108,7 @@ class PathLocatorTest extends UnitTestCase {
   public function testWebRoot(string $app_root, string $project_root, string $expected_web_root): void {
     $path_locator = $this->getMockBuilder(PathLocator::class)
       // Mock all methods except getWebRoot().
-      ->setMethodsExcept(['getWebRoot'])
+      ->onlyMethods(['getProjectRoot', 'getStagingRoot', 'getVendorDirectory'])
       ->setConstructorArgs([
         $app_root,
         $this->getConfigFactoryStub(),