Merge pull request #454 from yitam/rearrange

rearrange test folders into functional folder
This commit is contained in:
Jenny Tam 2017-06-23 15:25:01 -07:00 committed by GitHub
commit 42612dc804
460 changed files with 2197 additions and 2197 deletions

View file

@ -29,12 +29,12 @@ script:
- docker ps -a
- docker exec client python ./test/setup/setup_dbs.py -dbname $SQLSRV_DBNAME
- docker exec client python ./test/setup/setup_dbs.py -dbname $PDOSQLSRV_DBNAME
- docker exec client php ./source/pdo_sqlsrv/run-tests.php ./test/pdo_sqlsrv/*.phpt
- docker exec client php ./source/sqlsrv/run-tests.php ./test/sqlsrv/*.phpt
- docker exec client bash -c 'for f in ./test/sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client bash -c 'for f in ./test/sqlsrv/*.out; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client bash -c 'for f in ./test/pdo_sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client bash -c 'for f in ./test/pdo_sqlsrv/*.out; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client php ./source/pdo_sqlsrv/run-tests.php ./test/functional/pdo_sqlsrv/*.phpt
- docker exec client php ./source/sqlsrv/run-tests.php ./test/functional/sqlsrv/*.phpt
- docker exec client bash -c 'for f in ./test/functional/sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client bash -c 'for f in ./test/functional/sqlsrv/*.out; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client bash -c 'for f in ./test/functional/pdo_sqlsrv/*.diff; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client bash -c 'for f in ./test/functional/pdo_sqlsrv/*.out; do ls $f 2>/dev/null; cat $f 2>/dev/null; done || true'
- docker exec client python ./test/setup/cleanup_dbs.py -dbname $SQLSRV_DBNAME
- docker exec client python ./test/setup/cleanup_dbs.py -dbname $PDOSQLSRV_DBNAME
- docker exec client coveralls -e ./source/shared/ --gcov-options '\-lp'

View file

@ -67,13 +67,13 @@ WORKDIR $PHPSQLDIR/source/pdo_sqlsrv
RUN phpize && ./configure LDFLAGS="-lgcov" CXXFLAGS="-O0 --coverage" && make && make install
# set name of sql server host to use
WORKDIR $PHPSQLDIR/test/pdo_sqlsrv
WORKDIR $PHPSQLDIR/test/functional/pdo_sqlsrv
RUN sed -i -e 's/TARGET_SERVER/sql/g' MsSetup.inc
RUN sed -i -e 's/TARGET_DATABASE/msphpsql_pdosqlsrv/g' MsSetup.inc
RUN sed -i -e 's/TARGET_USERNAME/'"$TEST_PHP_SQL_UID"'/g' MsSetup.inc
RUN sed -i -e 's/TARGET_PASSWORD/'"$TEST_PHP_SQL_PWD"'/g' MsSetup.inc
WORKDIR $PHPSQLDIR/test/sqlsrv
WORKDIR $PHPSQLDIR/test/functional/sqlsrv
RUN sed -i -e 's/TARGET_SERVER/sql/g' MsSetup.inc
RUN sed -i -e 's/TARGET_DATABASE/msphpsql_sqlsrv/g' MsSetup.inc
RUN sed -i -e 's/TARGET_USERNAME/'"$TEST_PHP_SQL_UID"'/g' MsSetup.inc

View file

@ -123,10 +123,10 @@ install:
- 7z x -y php-sdk-binary-tools-20110915.zip -o%PHP_SDK%
- 7z x -y php.zip -o%PHP_SDK_DIR%
- echo update SQL connection string
- ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\pdo_sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:PDOSQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\pdo_sqlsrv\MsSetup.inc
- ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\pdo_sqlsrv\MsSetup.inc
- ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:SQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\sqlsrv\MsSetup.inc
- ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\sqlsrv\MsSetup.inc
- ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:PDOSQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc
- ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\pdo_sqlsrv\MsSetup.inc
- ps: (Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc) | ForEach-Object { $_ -replace "TARGET_SERVER", ${env:TEST_PHP_SQL_SERVER} -replace "TARGET_DATABASE", ${env:SQLSRV_DBNAME} -replace "TARGET_USERNAME", ${env:TEST_PHP_SQL_UID} -replace "TARGET_PASSWORD", ${env:TEST_PHP_SQL_PWD} } | Set-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc
- ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc
build_script:
- '"C:\\Program Files (x86)\\Microsoft Visual Studio %PHP_VC%.0\\VC\\vcvarsall.bat" %BUILD_PLATFORM%'
@ -166,15 +166,15 @@ test_script:
- python %APPVEYOR_BUILD_FOLDER%\test\setup\setup_dbs.py -dbname %SQLSRV_DBNAME%
- Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME%
- python %APPVEYOR_BUILD_FOLDER%\test\setup\setup_dbs.py -dbname %PDOSQLSRV_DBNAME%
- php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\sqlsrv.log 2>&1
- type %APPVEYOR_BUILD_FOLDER%\test\sqlsrv.log
- php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\pdo_sqlsrv.log 2>&1
- type %APPVEYOR_BUILD_FOLDER%\test\pdo_sqlsrv.log
- php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log 2>&1
- type %APPVEYOR_BUILD_FOLDER%\test\functional\sqlsrv.log
- php run-tests.php -p php.exe %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv\*.phpt > %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log 2>&1
- type %APPVEYOR_BUILD_FOLDER%\test\functional\pdo_sqlsrv.log
- python %APPVEYOR_BUILD_FOLDER%\test\setup\cleanup_dbs.py -dbname %SQLSRV_DBNAME%
- python %APPVEYOR_BUILD_FOLDER%\test\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME%
after_test:
- cd %APPVEYOR_BUILD_FOLDER%\test\
- cd %APPVEYOR_BUILD_FOLDER%\test\functional\
- python output.py
- ps: $difffiles = Get-ChildItem sqlsrv\*.diff
- ps: $outfiles = Get-ChildItem sqlsrv\*.out

View file

@ -1,35 +1,35 @@
--TEST--
Connection option APP name unicode
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
$appName = "APP_PoP_银河";
// Connect
$conn = new PDO("sqlsrv:server=$server;APP=$appName","$uid","$pwd");
// Query and Fetch
$query = "SELECT APP_NAME()";
$stmt = $conn->query($query);
while ( $row = $stmt->fetch(PDO::FETCH_NUM) ){
echo $row[0]."\n";
}
$stmt = $conn->query($query);
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ){
echo $row['']."\n";
}
// Free the connection
$conn=null;
echo "Done"
?>
--EXPECTREGEX--
APP_PoP_银河
APP_PoP_银河
Done
--TEST--
Connection option APP name unicode
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
$appName = "APP_PoP_银河";
// Connect
$conn = new PDO("sqlsrv:server=$server;APP=$appName","$uid","$pwd");
// Query and Fetch
$query = "SELECT APP_NAME()";
$stmt = $conn->query($query);
while ( $row = $stmt->fetch(PDO::FETCH_NUM) ){
echo $row[0]."\n";
}
$stmt = $conn->query($query);
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ){
echo $row['']."\n";
}
// Free the connection
$conn=null;
echo "Done"
?>
--EXPECTREGEX--
APP_PoP_银河
APP_PoP_银河
Done

View file

@ -1,50 +1,50 @@
--TEST--
Insert with quoted parameters
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
// Connect
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
$param = 'a \' g';
$param2 = $conn->quote( $param );
// Create a temporary table
$tableName = '#tmpTable';
$query = "CREATE TABLE $tableName (col1 VARCHAR(10), col2 VARCHAR(20))";
$stmt = $conn->exec($query);
if( $stmt === false ) { die(); }
// Inserd data
$query = "INSERT INTO $tableName VALUES( ?, '1' )";
$stmt = $conn->prepare( $query );
$stmt->execute(array($param));
// Inserd data
$query = "INSERT INTO $tableName VALUES( ?, ? )";
$stmt = $conn->prepare( $query );
$stmt->execute(array($param, $param2));
// Query
$query = "SELECT * FROM $tableName";
$stmt = $conn->query($query);
while ( $row = $stmt->fetch( PDO::FETCH_ASSOC ) ){
print_r( $row['col1'] ." was inserted\n" );
}
// Revert the inserts
$query = "delete from $tableName where col1 = ?";
$stmt = $conn->prepare( $query );
$stmt->execute(array($param));
//free the statement and connection
$stmt=null;
$conn=null;
?>
--EXPECT--
a ' g was inserted
a ' g was inserted
--TEST--
Insert with quoted parameters
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
// Connect
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
$param = 'a \' g';
$param2 = $conn->quote( $param );
// Create a temporary table
$tableName = '#tmpTable';
$query = "CREATE TABLE $tableName (col1 VARCHAR(10), col2 VARCHAR(20))";
$stmt = $conn->exec($query);
if( $stmt === false ) { die(); }
// Inserd data
$query = "INSERT INTO $tableName VALUES( ?, '1' )";
$stmt = $conn->prepare( $query );
$stmt->execute(array($param));
// Inserd data
$query = "INSERT INTO $tableName VALUES( ?, ? )";
$stmt = $conn->prepare( $query );
$stmt->execute(array($param, $param2));
// Query
$query = "SELECT * FROM $tableName";
$stmt = $conn->query($query);
while ( $row = $stmt->fetch( PDO::FETCH_ASSOC ) ){
print_r( $row['col1'] ." was inserted\n" );
}
// Revert the inserts
$query = "delete from $tableName where col1 = ?";
$stmt = $conn->prepare( $query );
$stmt->execute(array($param));
//free the statement and connection
$stmt=null;
$conn=null;
?>
--EXPECT--
a ' g was inserted
a ' g was inserted

View file

@ -1,56 +1,56 @@
--TEST--
Number of rows in a result set
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
// Create table
$tableName = '#tmpTable1';
$stmt = $conn->exec("CREATE TABLE $tableName (c1 VARCHAR(32))");
$stmt=null;
// Insert data
$query = "INSERT INTO $tableName VALUES ('Salmon'),('Butterfish'),('Cod'),('NULL'),('Crab')";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='Cod'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NULL'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NO_NAME'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='N/A'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
print_r($res);
$stmt=null;
$conn=null;
print "Done"
?>
--EXPECT--
Array
(
[0] => 5
[1] => 1
[2] => 1
[3] => 0
[4] => 5
)
Done
--TEST--
Number of rows in a result set
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once("MsSetup.inc");
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
// Create table
$tableName = '#tmpTable1';
$stmt = $conn->exec("CREATE TABLE $tableName (c1 VARCHAR(32))");
$stmt=null;
// Insert data
$query = "INSERT INTO $tableName VALUES ('Salmon'),('Butterfish'),('Cod'),('NULL'),('Crab')";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='Cod'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NULL'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NO_NAME'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
// Update data
$query = "UPDATE $tableName SET c1='N/A'";
$stmt = $conn->query($query);
$res[] = $stmt->rowCount();
print_r($res);
$stmt=null;
$conn=null;
print "Done"
?>
--EXPECT--
Array
(
[0] => 5
[1] => 1
[2] => 1
[3] => 0
[4] => 5
)
Done

Some files were not shown because too many files have changed in this diff Show more