com php-src: PDO_Firebird test update, round 2: ext/pdo_firebird/tests/bug_47415.phpt ext/ pdo_firebird/tests/bug_48877.phpt ext/pdo_f
irebird/tests/bug_53280.phpt ext/pdo_firebird /tests/bug_62024.phpt ext/pdo_firebird/tests/ bug_64037.phpt ext/pdo_firebird/tests/bug_ 72583.phpt
ext/pdo_firebird/tests/bug_72 931.phpt ext/pdo_firebird/tests/bug_7308 7.phpt ext/pdo_firebird/tests/bug_74462.p hpt
ext/pdo_firebird/tests/bug_76488.phpt e xt/pdo_firebird/tests

From: Date: Thu, 02 May 2019 20:19:27 +0000
Subject: com php-src: PDO_Firebird test update, round 2: ext/pdo_firebird/tests/bug_47415.phpt ext/ pdo_firebird/tests/bug_48877.phpt ext/pdo_f
irebird/tests/bug_53280.phpt ext/pdo_firebird /tests/bug_62024.phpt ext/pdo_firebird/tests/ bug_64037.phpt ext/pdo_firebird/tests/bug_ 72583.phpt
ext/pdo_firebird/tests/bug_72 931.phpt ext/pdo_firebird/tests/bug_7308 7.phpt ext/pdo_firebird/tests/bug_74462.p hpt
ext/pdo_firebird/tests/bug_76488.phpt e xt/pdo_firebird/tests
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106022@lists.php.net to get a copy of this message
Commit: 1c893b89bdb2b8bd5608c14cd0930727db6ba409 Author: Kalle Sommer Nielsen <kalle@php.net> Thu, 2 May 2019 23:19:27 +0300 Parents: c9599c1c726e3bce8ce5a80c1ac8ee2c81bffb61 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1c893b89bdb2b8bd5608c14cd0930727db6ba409 Log: PDO_Firebird test update, round 2 - This renames the environment variables to: PDO_FIREBIRD_TEST_XXX to be in line with other PDO test suites - Adds an skipif.inc file that skips the tests if no database is set - The test suite can now be run without PDO_FIREBIRD_TEST_HOSTNAME $ set PDO_FIREBIRD_TEST_HOSTNAME=localhost $ set PDO_FIREBIRD_TEST_DATABASE=C:\dev\php.fdb $ nmake test TESTS=ext/pdo_firebird/tests Changed paths: M ext/pdo_firebird/tests/bug_47415.phpt M ext/pdo_firebird/tests/bug_48877.phpt M ext/pdo_firebird/tests/bug_53280.phpt M ext/pdo_firebird/tests/bug_62024.phpt M ext/pdo_firebird/tests/bug_64037.phpt M ext/pdo_firebird/tests/bug_72583.phpt M ext/pdo_firebird/tests/bug_72931.phpt M ext/pdo_firebird/tests/bug_73087.phpt M ext/pdo_firebird/tests/bug_74462.phpt M ext/pdo_firebird/tests/bug_76488.phpt M ext/pdo_firebird/tests/bug_aaa.phpt M ext/pdo_firebird/tests/connect.phpt M ext/pdo_firebird/tests/ddl.phpt M ext/pdo_firebird/tests/execute.phpt D ext/pdo_firebird/tests/php.fdb M ext/pdo_firebird/tests/rowCount.phpt A ext/pdo_firebird/tests/skipif.inc M ext/pdo_firebird/tests/testdb.inc

diff --git a/ext/pdo_firebird/tests/bug_47415.phpt b/ext/pdo_firebird/tests/bug_47415.phpt index 1ceb69e..4b8c14d 100644 --- a/ext/pdo_firebird/tests/bug_47415.phpt +++ b/ext/pdo_firebird/tests/bug_47415.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindColumn() --SKIPIF-- -<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require 'testdb.inc'; diff --git a/ext/pdo_firebird/tests/bug_48877.phpt b/ext/pdo_firebird/tests/bug_48877.phpt index 8354df4..d685d0a 100644 --- a/ext/pdo_firebird/tests/bug_48877.phpt +++ b/ext/pdo_firebird/tests/bug_48877.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: bug 48877 The "bindValue" and "bindParam" do not work for PDO Firebird if we use named parameters (:parameter). --SKIPIF-- -<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/bug_53280.phpt b/ext/pdo_firebird/tests/bug_53280.phpt index 238263c..645f7b3 100644 --- a/ext/pdo_firebird/tests/bug_53280.phpt +++ b/ext/pdo_firebird/tests/bug_53280.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: bug 53280 segfaults if query column count is less than param count --SKIPIF-- -<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/bug_62024.phpt b/ext/pdo_firebird/tests/bug_62024.phpt index bf54b54..425a21f 100644 --- a/ext/pdo_firebird/tests/bug_62024.phpt +++ b/ext/pdo_firebird/tests/bug_62024.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #62024 Cannot insert second row with null using parametrized query (Firebird PDO) --SKIPIF-- -<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/bug_64037.phpt b/ext/pdo_firebird/tests/bug_64037.phpt index cda0b20..6fadab4 100644 --- a/ext/pdo_firebird/tests/bug_64037.phpt +++ b/ext/pdo_firebird/tests/bug_64037.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #64037 Firebird return wrong value for numeric field --SKIPIF-- -<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/bug_72583.phpt b/ext/pdo_firebird/tests/bug_72583.phpt index 7881677..87bc481 100644 --- a/ext/pdo_firebird/tests/bug_72583.phpt +++ b/ext/pdo_firebird/tests/bug_72583.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: Feature 72583 Fetch integers as php integers not as strings --SKIPIF-- -<?php if (!extension_loaded('pdo_firebird')) die('skip'); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require 'testdb.inc'; diff --git a/ext/pdo_firebird/tests/bug_72931.phpt b/ext/pdo_firebird/tests/bug_72931.phpt index f0cb53f..56270ba 100644 --- a/ext/pdo_firebird/tests/bug_72931.phpt +++ b/ext/pdo_firebird/tests/bug_72931.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: Bug 72931 Insert returning fails on Firebird 3 --SKIPIF-- -<?php if (!extension_loaded('pdo_firebird')) die('skip'); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require 'testdb.inc'; diff --git a/ext/pdo_firebird/tests/bug_73087.phpt b/ext/pdo_firebird/tests/bug_73087.phpt index 77544ef..b676293 100644 --- a/ext/pdo_firebird/tests/bug_73087.phpt +++ b/ext/pdo_firebird/tests/bug_73087.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: bug 73087 segfault binding blob parameter --SKIPIF-- -<?php if if(!extension_loaded('pdo_firebird')) die('skip'); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require 'testdb.inc'; diff --git a/ext/pdo_firebird/tests/bug_74462.phpt b/ext/pdo_firebird/tests/bug_74462.phpt index 6c5563c..fe97a1f 100644 --- a/ext/pdo_firebird/tests/bug_74462.phpt +++ b/ext/pdo_firebird/tests/bug_74462.phpt @@ -1,8 +1,7 @@ --TEST-- PDO_Firebird: Bug #74462 Returns only NULLs for boolean fields --SKIPIF-- -<?php if (!extension_loaded('pdo_firebird')) die('skip'); -?> +<?php require('skipif.inc'); ?> --FILE-- <?php require 'testdb.inc'; diff --git a/ext/pdo_firebird/tests/bug_76488.phpt b/ext/pdo_firebird/tests/bug_76488.phpt index 886e22e..ffcca7e 100644 --- a/ext/pdo_firebird/tests/bug_76488.phpt +++ b/ext/pdo_firebird/tests/bug_76488.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: Bug #76488 Memory leak when fetching a BLOB field --SKIPIF-- -<?php if (!extension_loaded('pdo_firebird')) die('skip'); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require 'testdb.inc'; diff --git a/ext/pdo_firebird/tests/bug_aaa.phpt b/ext/pdo_firebird/tests/bug_aaa.phpt index 033e13a..2849cef 100644 --- a/ext/pdo_firebird/tests/bug_aaa.phpt +++ b/ext/pdo_firebird/tests/bug_aaa.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: cursor should not be marked as opened on singleton statements --SKIPIF-- -<?php if (!extension_loaded('pdo_firebird')) die('skip'); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require 'testdb.inc'; diff --git a/ext/pdo_firebird/tests/connect.phpt b/ext/pdo_firebird/tests/connect.phpt index 41643fe..20f0ce7 100644 --- a/ext/pdo_firebird/tests/connect.phpt +++ b/ext/pdo_firebird/tests/connect.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: connect/disconnect --SKIPIF-- -<?php if (!extension_loaded('pdo_firebird')) die('skip'); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require("testdb.inc"); diff --git a/ext/pdo_firebird/tests/ddl.phpt b/ext/pdo_firebird/tests/ddl.phpt index 230bf1d..b89c704 100644 --- a/ext/pdo_firebird/tests/ddl.phpt +++ b/ext/pdo_firebird/tests/ddl.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: DDL/transactions --SKIPIF-- -<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/execute.phpt b/ext/pdo_firebird/tests/execute.phpt index 6a5d953..0f1721f 100644 --- a/ext/pdo_firebird/tests/execute.phpt +++ b/ext/pdo_firebird/tests/execute.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: prepare/execute/binding --SKIPIF-- -<?php extension_loaded('pdo_firebird') or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php require("testdb.inc"); diff --git a/ext/pdo_firebird/tests/php.fdb b/ext/pdo_firebird/tests/php.fdb deleted file mode 100644 index 0dc415e..0000000 Binary files a/ext/pdo_firebird/tests/php.fdb and /dev/null differ diff --git a/ext/pdo_firebird/tests/rowCount.phpt b/ext/pdo_firebird/tests/rowCount.phpt index d7c67a4..81982e9 100644 --- a/ext/pdo_firebird/tests/rowCount.phpt +++ b/ext/pdo_firebird/tests/rowCount.phpt @@ -1,7 +1,7 @@ --TEST-- PDO_Firebird: rowCount --SKIPIF-- -<?php extension_loaded("pdo_firebird") or die("skip"); ?> +<?php require('skipif.inc'); ?> --FILE-- <?php diff --git a/ext/pdo_firebird/tests/skipif.inc b/ext/pdo_firebird/tests/skipif.inc new file mode 100644 index 0000000..a066d21 --- /dev/null +++ b/ext/pdo_firebird/tests/skipif.inc @@ -0,0 +1,12 @@ +<?php + +if(!extension_loaded('pdo_firebird')) +{ + die('skip: pdo_firebird not available'); +} +elseif(!getenv('PDO_FIREBIRD_TEST_DATABASE')) +{ + die('skip: PDO_FIREBIRD_TEST_DATABASE must be set'); +} + +?> \ No newline at end of file diff --git a/ext/pdo_firebird/tests/testdb.inc b/ext/pdo_firebird/tests/testdb.inc index 2daf22c..c18df08 100644 --- a/ext/pdo_firebird/tests/testdb.inc +++ b/ext/pdo_firebird/tests/testdb.inc @@ -4,14 +4,26 @@ // // Username: SYSDBA // Password: phpfi -// Database: <path/to/ext/pdo_firebird/tests/>php.fdb +// Database: <nothing> // -// (Assumes FireBird flavor over InterBase by default) +// A path to a database must be specified by using PDO_FIREBIRD_TEST_DATABASE -define('PDO_FIREBIRD_USERNAME', getenv('PDO_FIREBIRD_USERNAME') ?: 'SYSDBA'); -define('PDO_FIREBIRD_PASSWORD', getenv('PDO_FIREBIRD_PASSWORD') ?: 'phpfi'); -define('PDO_FIREBIRD_HOSTNAME', getenv('PDO_FIREBIRD_HOSTNAME') ?: 'localhost'); -define('PDO_FIREBIRD_DATABASE', getenv('PDO_FIREBIRD_DATABASE') ?: __DIR__ . DIRECTORY_SEPARATOR . 'php.fdb'); +define('PDO_FIREBIRD_TEST_USERNAME', getenv('PDO_FIREBIRD_TEST_USERNAME') ?: 'SYSDBA'); +define('PDO_FIREBIRD_TEST_PASSWORD', getenv('PDO_FIREBIRD_TEST_PASSWORD') ?: 'phpfi'); +define('PDO_FIREBIRD_TEST_HOSTNAME', getenv('PDO_FIREBIRD_TEST_HOSTNAME') ?: 'localhost'); +define('PDO_FIREBIRD_TEST_DATABASE', getenv('PDO_FIREBIRD_TEST_DATABASE') ?: ''); -$dbh = new PDO('firebird:dbname=' . PDO_FIREBIRD_HOSTNAME . ':' . PDO_FIREBIRD_DATABASE, PDO_FIREBIRD_USERNAME, PDO_FIREBIRD_PASSWORD) or die; +if(!PDO_FIREBIRD_TEST_DATABASE) +{ + die('Error: PDO_FIREBIRD_TEST_DATABASE must be set'); +} + +if(PDO_FIREBIRD_TEST_HOSTNAME) +{ + $dbh = new PDO('firebird:dbname=' . PDO_FIREBIRD_TEST_HOSTNAME . ':' . PDO_FIREBIRD_TEST_DATABASE, PDO_FIREBIRD_TEST_USERNAME, PDO_FIREBIRD_TEST_PASSWORD) or die; +} +else +{ + $dbh = new PDO('firebird:dbname=' . PDO_FIREBIRD_TEST_DATABASE, PDO_FIREBIRD_TEST_USERNAME, PDO_FIREBIRD_TEST_PASSWORD) or die; +} ?> \ No newline at end of file
« previous php.cvs (#106022) next »