From: Remi Collet Date: Mon, 12 Jun 2023 15:10:22 +0000 (+0200) Subject: use serverVersion to skip json test X-Git-Tag: v2.2.3~3^2~4 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c8b946f8140cebf645d7b5bf5bc7140583a7096d;p=m6w6%2Fext-pq use serverVersion to skip json test --- diff --git a/package.xml b/package.xml index 402e0db..1c7ba19 100644 --- a/package.xml +++ b/package.xml @@ -118,6 +118,7 @@ + diff --git a/tests/_skipif.inc b/tests/_skipif.inc index 9bf235c..0391d77 100644 --- a/tests/_skipif.inc +++ b/tests/_skipif.inc @@ -6,7 +6,10 @@ _ext("pq"); include "_setup.inc"; defined("PQ_DSN") or die("skip PQ_DSN undefined"); try { - new pq\Connection(PQ_DSN); + $c = new pq\Connection(PQ_DSN); + if (defined("SERVER_MIN") && version_compare(SERVER_MIN, $c->serverVersion) > 0) { + die("skip server {$c->serverVersion} is too old, needed " . SERVER_MIN); + } } catch (pq\Exception $e) { die("skip could not connect to PQ_DSN ".$e->getMessage()); } diff --git a/tests/basic003.phpt b/tests/basic003.phpt new file mode 100644 index 0000000..4645e8c --- /dev/null +++ b/tests/basic003.phpt @@ -0,0 +1,22 @@ +--TEST-- +basic functionality +--SKIPIF-- + +--FILE-- +libraryVersion); +var_dump($c->protocolVersion); +var_dump($c->serverVersion); +?> +DONE +--EXPECTF-- +Test +string(%d) "%s" +int(%d) +string(%d) "%s" +DONE diff --git a/tests/gh-issue047_jsonb.phpt b/tests/gh-issue047_jsonb.phpt index 1f049d4..5e145fb 100644 --- a/tests/gh-issue047_jsonb.phpt +++ b/tests/gh-issue047_jsonb.phpt @@ -2,6 +2,7 @@ json conv broken since 2.2.1 --SKIPIF-- --INI--