Verified Commit e3983382 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3280882 by mondrake, mallezie: KernelTestBase::tearDown() cleanup...

Issue #3280882 by mondrake, mallezie: KernelTestBase::tearDown() cleanup prevents good typehinting practices
parent bb0fa107
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -660,20 +660,6 @@ protected function tearDown(): void {
    $this->vfsRoot = NULL;
    $this->configImporter = NULL;

    // Free up memory: Custom test class properties.
    // Note: Private properties cannot be cleaned up.
    $rc = new \ReflectionClass(__CLASS__);
    $blacklist = [];
    foreach ($rc->getProperties() as $property) {
      $blacklist[$property->name] = $property->getDeclaringClass()->name;
    }
    $rc = new \ReflectionClass($this);
    foreach ($rc->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $property) {
      if (!$property->isStatic() && !isset($blacklist[$property->name])) {
        $this->{$property->name} = NULL;
      }
    }

    // Clean FileCache cache.
    FileCache::reset();