Skip to content

Commit 7d9eb81

Browse files
author
Mathew
committed
test fix
1 parent 09b6ebc commit 7d9eb81

6 files changed

Lines changed: 23 additions & 6 deletions

tests/php/test_1_initial_test.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
require ("vendor/autoload.php");
55

6-
$ac = new ApiClient("http://127.0.0.1:8081");
6+
7+
$host = $argv[1] ?? '127.0.0.1';
8+
$port = (int)($argv[2] ?? 8081);
9+
$ac = new ApiClient("http://$host:$port");
710

811
$ret = $ac->key_get("non-existant", "its-a-404");
912
if($ret !== null) exit(1);

tests/php/test_2_put_get.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
require ("vendor/autoload.php");
66

7-
$ac = new ApiClient("http://127.0.0.1:8081");
7+
8+
9+
$host = $argv[1] ?? '127.0.0.1';
10+
$port = (int)($argv[2] ?? 8081);
11+
$ac = new ApiClient("http://$host:$port");
812

913
$ret = $ac->key_put("t1", "k1", "v1");
1014

tests/php/test_2_put_get_big.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
require ("vendor/autoload.php");
66

7-
$ac = new ApiClient("http://127.0.0.1:8081");
7+
8+
9+
$host = $argv[1] ?? '127.0.0.1';
10+
$port = (int)($argv[2] ?? 8081);
11+
$ac = new ApiClient("http://$host:$port");
812

913
function generateRandomString($length = 10) {
1014
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

tests/php/test_3_competing_writes.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ function generateRandomString($length = 10) {
1818
for($i=0;$i<3;$i++){
1919
$pid = pcntl_fork();
2020
if(!$pid){
21-
$ac = new ApiClient("http://127.0.0.1:8081");
21+
$host = $argv[1] ?? '127.0.0.1';
22+
$port = (int)($argv[2] ?? 8081);
23+
$ac = new ApiClient("http://$host:$port");
2224

2325

2426
for($f=0;$f<20;$f++){

tests/php/test_4_randomly_interrupt.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
for($i=0;$i<100;$i++){
88
if(pcntl_fork() == NULL){
9-
$ac = new ApiClient("http://127.0.0.1:8081");
9+
$host = $argv[1] ?? '127.0.0.1';
10+
$port = (int)($argv[2] ?? 8081);
11+
$ac = new ApiClient("http://$host:$port");
1012

1113

1214
$i = -1;

tests/php/test_4_randomly_interrupt_big.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ function generateRandomString($length = 10) {
1818
for($i=0;$i<20;$i++){
1919
$pid = pcntl_fork();
2020
if(!$pid){
21-
$ac = new ApiClient("http://127.0.0.1:8081");
21+
$host = $argv[1] ?? '127.0.0.1';
22+
$port = (int)($argv[2] ?? 8081);
23+
$ac = new ApiClient("http://$host:$port");
2224

2325

2426
$i = -1;

0 commit comments

Comments
 (0)