-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeaderTest.php
More file actions
25 lines (19 loc) · 667 Bytes
/
HeaderTest.php
File metadata and controls
25 lines (19 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
declare(strict_types=1);
use DragonCode\RequestTracker\TrackerHeader;
it('uses default header names', function () {
$header = new TrackerHeader;
expect($header->userId)->toBe('X-Tracker-User-Id')
->and($header->ip)->toBe('X-Tracker-Ip')
->and($header->traceId)->toBe('X-Tracker-Trace-Id');
});
it('accepts custom header names', function () {
$header = new TrackerHeader(
userId : 'Some-User-Id',
ip : 'Some-IP',
traceId: 'Some-Trace-Id',
);
expect($header->userId)->toBe('Some-User-Id')
->and($header->ip)->toBe('Some-IP')
->and($header->traceId)->toBe('Some-Trace-Id');
});