Commit 2e6d96c2 authored by catch's avatar catch
Browse files

Issue #3326378 by Spokje: Fix PHPStan L1 error "Instantiated class Foo\Bar not found."

parent a0218f8a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public function _buildFakeModule() {
      $output = [];
      exec('rm -Rf ' . escapeshellarg($location), $output, $ret);
      if ($ret != 0) {
        throw new Exception('Error removing fake module directory.');
        throw new \Exception('Error removing fake module directory.');
      }
    }

+0 −25
Original line number Diff line number Diff line
@@ -2200,11 +2200,6 @@ parameters:
			count: 1
			path: modules/system/tests/modules/module_installer_config_test/src/Entity/TestConfigType.php

		-
			message: "#^Instantiated class Drupal\\\\Tests\\\\system\\\\Functional\\\\FileTransfer\\\\Exception not found\\.$#"
			count: 1
			path: modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php

		-
			message: "#^Access to an undefined property Drupal\\\\Tests\\\\system\\\\Functional\\\\FileTransfer\\\\TestFileTransfer\\:\\:\\$connection\\.$#"
			count: 5
@@ -3090,16 +3085,6 @@ parameters:
			count: 1
			path: tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php

		-
			message: "#^Instantiated class Drupal\\\\FunctionalTests\\\\BrowserMissingDependentModuleMethodTest not found\\.$#"
			count: 1
			path: tests/Drupal/KernelTests/Core/Test/BrowserTestBaseTest.php

		-
			message: "#^Instantiated class Drupal\\\\FunctionalTests\\\\BrowserMissingDependentModuleTest not found\\.$#"
			count: 1
			path: tests/Drupal/KernelTests/Core/Test/BrowserTestBaseTest.php

		-
			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
			count: 5
@@ -3110,16 +3095,6 @@ parameters:
			count: 1
			path: tests/Drupal/KernelTests/KernelTestBase.php

		-
			message: "#^Instantiated class Drupal\\\\KernelTests\\\\KernelMissingDependentModuleMethodTest not found\\.$#"
			count: 1
			path: tests/Drupal/KernelTests/KernelTestBaseTest.php

		-
			message: "#^Instantiated class Drupal\\\\KernelTests\\\\KernelMissingDependentModuleTest not found\\.$#"
			count: 1
			path: tests/Drupal/KernelTests/KernelTestBaseTest.php

		-
			message: "#^Call to an undefined method Drupal\\\\TestSite\\\\Commands\\\\TestSiteInstallCommand\\:\\:assertTrue\\(\\)\\.$#"
			count: 1
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ class BrowserTestBaseTest extends KernelTestBase {
  public function testMethodRequiresModule() {
    require __DIR__ . '/../../../../fixtures/BrowserMissingDependentModuleMethodTest.php';

    // @phpstan-ignore-next-line
    $stub_test = new BrowserMissingDependentModuleMethodTest();
    // We have to setName() to the method name we're concerned with.
    $stub_test->setName('testRequiresModule');
@@ -54,6 +55,7 @@ public function testMethodRequiresModule() {
  public function testRequiresModule() {
    require __DIR__ . '/../../../../fixtures/BrowserMissingDependentModuleTest.php';

    // @phpstan-ignore-next-line
    $stub_test = new BrowserMissingDependentModuleTest();
    // We have to setName() to the method name we're concerned with.
    $stub_test->setName('testRequiresModule');
+2 −0
Original line number Diff line number Diff line
@@ -254,6 +254,7 @@ public function testLocalTimeZone() {
  public function testMethodRequiresModule() {
    require __DIR__ . '/../../fixtures/KernelMissingDependentModuleMethodTest.php';

    // @phpstan-ignore-next-line
    $stub_test = new KernelMissingDependentModuleMethodTest();
    // We have to setName() to the method name we're concerned with.
    $stub_test->setName('testRequiresModule');
@@ -281,6 +282,7 @@ public function testMethodRequiresModule() {
  public function testRequiresModule() {
    require __DIR__ . '/../../fixtures/KernelMissingDependentModuleTest.php';

    // @phpstan-ignore-next-line
    $stub_test = new KernelMissingDependentModuleTest();
    // We have to setName() to the method name we're concerned with.
    $stub_test->setName('testRequiresModule');
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
 * This is a fixture class for
 * \Drupal\FunctionalTests\BrowserTestBaseTest::testMethodRequiresModule().
 *
 * This test class should not be discovered by run-tests.sh or phpunit.
 * This test class should not be discovered by run-tests.sh, phpstan or phpunit.
 *
 * @group fixture
 */
Loading