Skip to content

Commit

Permalink
fix: mockery tests being considered as risky
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed May 24, 2020
1 parent 340c7ca commit 415f571
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Repositories/AfterEachRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public function get(string $filename): Closure

return ChainableClosure::from(function (): void {
if (class_exists(Mockery::class)) {
/* @phpstan-ignore-next-line */
if ($container = Mockery::getContainer()) {
/* @phpstan-ignore-next-line */
$this->addToAssertionCount($container->mockery_getExpectationCount());
}

Mockery::close();
}
}, $afterEach);
Expand Down
2 changes: 1 addition & 1 deletion tests/Features/Mocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public function bar(): int;
->times(1)
->andReturn(2);

assertEquals(2, $mock->bar());
$mock->bar();
});

0 comments on commit 415f571

Please sign in to comment.