Skip to content

Commit 25dadb2

Browse files
committed
use PSR-7 for IP address middleware
1 parent 105792a commit 25dadb2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

test.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ function runTest(Config $config, string $file, string $category): array
8484
$in = $parts[$i];
8585
$exp = $parts[$i + 1];
8686
$api = new Api($config);
87-
$_SERVER['REMOTE_ADDR'] = 'TEST_IP';
8887
$out = ResponseUtils::toString($api->handle(RequestFactory::fromString($in)));
8988
if ($recording) {
9089
$parts[$i + 1] = $out;
@@ -133,7 +132,6 @@ function getPassword(Config $config)
133132
return $config->getMiddlewares()['reconnect']['passwordHandler']();
134133
}
135134

136-
137135
function loadFixture(string $dir, Config $config)
138136
{
139137
$driver = $config->getDriver();

tests/functional/001_records/080_add_barcode_with_ip_address.log

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ GET /records/barcodes/2
1313
===
1414
200
1515
Content-Type: application/json; charset=utf-8
16-
Content-Length: 64
16+
Content-Length: 66
1717

18-
{"id":2,"product_id":1,"hex":"","bin":"","ip_address":"TEST_IP"}
18+
{"id":2,"product_id":1,"hex":"","bin":"","ip_address":"127.0.0.1"}
1919
===
2020
PUT /records/barcodes/2
2121

@@ -31,9 +31,9 @@ GET /records/barcodes/2
3131
===
3232
200
3333
Content-Type: application/json; charset=utf-8
34-
Content-Length: 64
34+
Content-Length: 66
3535

36-
{"id":2,"product_id":1,"hex":"","bin":"","ip_address":"TEST_IP"}
36+
{"id":2,"product_id":1,"hex":"","bin":"","ip_address":"127.0.0.1"}
3737
===
3838
DELETE /records/barcodes/2
3939
===

0 commit comments

Comments
 (0)