Skip to content

Commit

Permalink
Merge pull request #14 from Roave/feature/ensure-no-leaks-from-prophe…
Browse files Browse the repository at this point in the history
…cy-mocks

Verify that Prophecy mocks don't leak
  • Loading branch information
Ocramius authored Jan 6, 2021
2 parents 83c0913 + e47c1e9 commit aef0f9a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/e2e/LeakyIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ public function doesLeakATinyAmountOfMemory(): void
$this->addToAssertionCount(1);
}

/** @test */
public function doesNotLeakGarbageCollectedMocks(): void
{
$this->createMock(stdClass::class);

$this->addToAssertionCount(1);
}

/** @test */
public function doesNotLeakGarbageCollectedProphecyMocks(): void
{
LeakyStaticObject::leak($this->prophesize(stdClass::class));

$this->addToAssertionCount(1);
}

/** @test */
public function doesLeakAMock(): void
{
Expand All @@ -55,6 +71,14 @@ public function doesLeakAMock(): void
$this->addToAssertionCount(1);
}

/** @test */
public function doesLeakAProphecyMock(): void
{
LeakyStaticObject::leak($this->prophesize(stdClass::class));

$this->addToAssertionCount(1);
}

/** @test */
public function doesLeakOneObject(): void
{
Expand Down

0 comments on commit aef0f9a

Please sign in to comment.