Skip to content

Commit

Permalink
Ensure tests manually tear down props (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck authored and clxmstaab committed Jul 19, 2021
1 parent ca53816 commit 945fbe2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/Testing/PHPUnit/AbstractRectorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,16 @@ private function processFileInfo(SmartFileInfo $fileInfo): string

return $file->getFileContent();
}

protected function tearDown(): void
{
unset(
$this->applicationFileProcessor,
$this->parameterProvider,
$this->dynamicSourceLocatorProvider,
$this->removedAndAddedFilesCollector,
$this->originalTempFileInfo,
);
gc_collect_cycles();
}
}
5 changes: 5 additions & 0 deletions rules-tests/TypeDeclaration/TypeNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ public function provideDataNormalizeArrayOfUnionToUnionArray(): Iterator
$evenMoreNestedArrayType = new ArrayType(new MixedType(), $moreNestedArrayType);
yield [$evenMoreNestedArrayType, 'int[][][]|string[][][]'];
}

protected function tearDown(): void
{
unset($this->typeNormalizer);
}
}

0 comments on commit 945fbe2

Please sign in to comment.