Skip to content

Commit

Permalink
Merge branch 'main' of github.com:stfndamjanovic/php-circuit-breaker
Browse files Browse the repository at this point in the history
  • Loading branch information
stfndamjanovic committed Jan 22, 2024
2 parents e54d736 + c2ae1d9 commit a6b5032
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/CircuitBreakerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function test_if_listener_before_call_is_triggered()
{
$object = new class () extends CircuitBreakerListener {
public int $count = 0;

public function beforeCall(\Closure $action, ...$args): void
{
$this->count++;
Expand All @@ -179,8 +180,8 @@ public function beforeCall(\Closure $action, ...$args): void

$breaker = CircuitBreaker::for('test-service')->withListeners([$object]);

$breaker->call(fn() => true);
$breaker->call(fn() => true);
$breaker->call(fn () => true);
$breaker->call(fn () => true);

$this->assertEquals(2, $object->count);
}
Expand Down

0 comments on commit a6b5032

Please sign in to comment.