some tests for Windows only
This commit is contained in:
parent
78c0f6f4e6
commit
2fcff55432
|
@ -53,7 +53,7 @@ def TestFilename(line):
|
|||
while True:
|
||||
currentPos = currentPos - 1
|
||||
# if passed the first pos, stop
|
||||
if currentPos < firstpos
|
||||
if currentPos < firstpos:
|
||||
break
|
||||
line[currentPos]
|
||||
if line[currentPos] == terminateChar:
|
||||
|
|
|
@ -6,7 +6,7 @@ when an URI-based construct is used.
|
|||
--ENV--
|
||||
PHPT_EXEC=true
|
||||
--SKIPIF--
|
||||
<?php if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." ); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'MsCommon.inc';
|
||||
|
|
|
@ -6,7 +6,7 @@ when an URI-based construct is used.
|
|||
--ENV--
|
||||
PHPT_EXEC=true
|
||||
--SKIPIF--
|
||||
<?php if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." ); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'MsCommon.inc';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--TEST--
|
||||
Test the connection resiliency keywords ConnectRetryCount and ConnectRetryInterval and their ranges of acceptable values
|
||||
--SKIPIF--
|
||||
<?php if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, not running on windows." ); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once( "MsSetup.inc" );
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
||||
die("PDO driver cannot be loaded; skipping test.\n");
|
||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
||||
die("PDO driver cannot be loaded; skipping test.\n");
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
||||
die("PDO driver cannot be loaded; skipping test.\n");
|
||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
||||
die("PDO driver cannot be loaded; skipping test.\n");
|
||||
|
||||
include 'MsCommon.inc';
|
||||
if ( IsDaasMode() ) {
|
||||
|
|
8
test/pdo_sqlsrv/skipif_unix.inc
Normal file
8
test/pdo_sqlsrv/skipif_unix.inc
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." );
|
||||
|
||||
if (!extension_loaded("pdo") || !extension_loaded('pdo_sqlsrv'))
|
||||
die("PDO driver cannot be loaded; skipping test.\n");
|
||||
|
||||
?>
|
|
@ -3,7 +3,7 @@ Test the connection resiliency keywords
|
|||
--DESCRIPTION--
|
||||
Test the connection resiliency keywords ConnectRetryCount and ConnectRetryInterval and their ranges of acceptable values
|
||||
--SKIPIF--
|
||||
<?php if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." ); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once( "MsSetup.inc" );
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
if (!extension_loaded("sqlsrv")) {
|
||||
die("skip extension not loaded");
|
||||
die("skip extension not loaded");
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
if (!extension_loaded("sqlsrv")) {
|
||||
die("skip extension not loaded");
|
||||
die("skip extension not loaded");
|
||||
}
|
||||
|
||||
include 'MsCommon.inc';
|
||||
|
|
9
test/sqlsrv/skipif_unix.inc
Normal file
9
test/sqlsrv/skipif_unix.inc
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." );
|
||||
|
||||
if (!extension_loaded("sqlsrv")) {
|
||||
die("skip extension not loaded");
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,31 +0,0 @@
|
|||
--TEST--
|
||||
Verify sqlsrv_client_info
|
||||
--SKIPIF--
|
||||
<?php require('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
|
||||
sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL );
|
||||
sqlsrv_configure( 'LogSubsystems', SQLSRV_LOG_SYSTEM_OFF );
|
||||
|
||||
require( 'MsCommon.inc' );
|
||||
|
||||
$conn = Connect();
|
||||
if( !$conn ) {
|
||||
FatalError("Could not connect");
|
||||
}
|
||||
|
||||
$client_info = sqlsrv_client_info( $conn );
|
||||
var_dump( $client_info );
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
array\(4\) {
|
||||
\[\"(DriverDllName|DriverName)\"\]=>
|
||||
(string\(15\) \"msodbcsql1[1-9].dll\"|string\(24\) \"libmsodbcsql-[1-9]{2}.0.so.1.0\")
|
||||
\[\"DriverODBCVer\"\]=>
|
||||
string\(5\) \"[0-9]{1,2}\.[0-9]{1,2}\"
|
||||
\[\"DriverVer\"\]=>
|
||||
string\(10\) \"[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}\"
|
||||
\[\"ExtensionVer\"\]=>
|
||||
string\([0-9]+\) \"[0-9]\.[0-9]\.[0-9](\-((rc)|(preview))(\.[0-9]+)?)?(\+[0-9]+)?\"
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
--TEST--
|
||||
UTF-8 connection strings
|
||||
--SKIPIF--
|
||||
<?php require('skipif.inc'); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--TEST--
|
||||
reading different encodings in strings and streams.
|
||||
--SKIPIF--
|
||||
<?php if ( !( strtoupper( substr( php_uname( 's' ),0,3 ) ) === 'WIN' ) ) die( "Skip, test on windows only." ); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
|
|
@ -40,9 +40,12 @@ if( $stmt === false ) {
|
|||
die( print_r( sqlsrv_errors(), true ));
|
||||
}
|
||||
while( sqlsrv_next_result( $stmt )) {}
|
||||
print_r( strlen( $outValue1 ));
|
||||
echo "\n";
|
||||
print_r( substr( $outValue1, -2, 2 ));
|
||||
|
||||
if ( strlen( $outValue1 ) != 4000 )
|
||||
echo "Length of returned value unexpected!\n";
|
||||
$str = substr( $outValue1, -2, 2 );
|
||||
if ($str != 'AA')
|
||||
echo "Returned substring $str invalid!\n";
|
||||
|
||||
$field_type = 'VARCHAR(8000)';
|
||||
$inValue1 = str_repeat( "A", 7999 );
|
||||
|
@ -68,10 +71,12 @@ if( $stmt === false ) {
|
|||
die( print_r( sqlsrv_errors(), true ));
|
||||
}
|
||||
while( sqlsrv_next_result( $stmt )) {}
|
||||
echo "\n";
|
||||
print_r( strlen( $outValue1 ));
|
||||
echo "\n";
|
||||
print_r( substr( $outValue1, -2, 2 ));
|
||||
|
||||
if ( strlen( $outValue1 ) != 8000 )
|
||||
echo "Length of returned value unexpected!\n";
|
||||
$str = substr( $outValue1, -2, 2 );
|
||||
if ($str != 'AA')
|
||||
echo "Returned substring $str invalid!\n";
|
||||
|
||||
$field_type = 'VARBINARY(8000)';
|
||||
$inValue1 = str_repeat( "A", 7999 );
|
||||
|
@ -97,19 +102,18 @@ if( $stmt === false ) {
|
|||
die( print_r( sqlsrv_errors(), true ));
|
||||
}
|
||||
while( sqlsrv_next_result( $stmt )) {}
|
||||
echo "\n";
|
||||
print_r( strlen( $outValue1 ));
|
||||
echo "\n";
|
||||
print_r( substr( $outValue1, -2, 2 ));
|
||||
|
||||
if ( strlen( $outValue1 ) != 8000 )
|
||||
echo "Length of returned value unexpected!\n";
|
||||
$str = substr( $outValue1, -2, 2 );
|
||||
if ($str != 'AB')
|
||||
echo "Returned substring $str invalid!\n";
|
||||
|
||||
echo "Test complete.\n";
|
||||
|
||||
sqlsrv_free_stmt( $stmt );
|
||||
sqlsrv_close( $conn ); // True
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
4000
|
||||
AA
|
||||
8000
|
||||
AA
|
||||
8000
|
||||
AB
|
||||
Test complete.
|
|
@ -1,7 +1,7 @@
|
|||
--TEST--
|
||||
warnings as errors
|
||||
--SKIPIF--
|
||||
<?php require('skipif.inc'); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--TEST--
|
||||
warnings as errors
|
||||
--SKIPIF--
|
||||
<?php require('skipif.inc'); ?>
|
||||
<?php require('skipif_unix.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
|
Loading…
Reference in a new issue