diff --git a/tests/Unit/Factory.php b/tests/Unit/Factory.php index d0814f4..5da6606 100644 --- a/tests/Unit/Factory.php +++ b/tests/Unit/Factory.php @@ -72,3 +72,16 @@ expect($this->stress->method())->toBe('post') ->and($this->stress->payload())->toBe(['foo' => 'bar']); }); + +it('correctly sets the headers', function (): void { + $this->stress->headers(['foo' => 'bar']); + + $class = new \ReflectionClass($this->stress); + $protected = $class->getProperty('headers'); + $protected->setAccessible(true); + + $instance = $this->stress; + $headers = $protected->getValue($instance); + + expect($headers)->toBe(['foo' => 'bar']); +});