Skip to content

Commit

Permalink
Add test for headers
Browse files Browse the repository at this point in the history
  • Loading branch information
DarronEngelbrecht committed Nov 23, 2024
1 parent f5cfec0 commit 3816a12
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Unit/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});

0 comments on commit 3816a12

Please sign in to comment.