Merge pull request #454 from yitam/rearrange
rearrange test folders into functional folder
This commit is contained in:
commit
42612dc804
12
.travis.yml
12
.travis.yml
|
@ -29,12 +29,12 @@ script:
|
||||||
- docker ps -a
|
- 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 $SQLSRV_DBNAME
|
||||||
- docker exec client python ./test/setup/setup_dbs.py -dbname $PDOSQLSRV_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/pdo_sqlsrv/run-tests.php ./test/functional/pdo_sqlsrv/*.phpt
|
||||||
- docker exec client php ./source/sqlsrv/run-tests.php ./test/sqlsrv/*.phpt
|
- docker exec client php ./source/sqlsrv/run-tests.php ./test/functional/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/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/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/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/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/pdo_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/*.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 $SQLSRV_DBNAME
|
||||||
- docker exec client python ./test/setup/cleanup_dbs.py -dbname $PDOSQLSRV_DBNAME
|
- docker exec client python ./test/setup/cleanup_dbs.py -dbname $PDOSQLSRV_DBNAME
|
||||||
- docker exec client coveralls -e ./source/shared/ --gcov-options '\-lp'
|
- docker exec client coveralls -e ./source/shared/ --gcov-options '\-lp'
|
||||||
|
|
|
@ -67,13 +67,13 @@ WORKDIR $PHPSQLDIR/source/pdo_sqlsrv
|
||||||
RUN phpize && ./configure LDFLAGS="-lgcov" CXXFLAGS="-O0 --coverage" && make && make install
|
RUN phpize && ./configure LDFLAGS="-lgcov" CXXFLAGS="-O0 --coverage" && make && make install
|
||||||
|
|
||||||
# set name of sql server host to use
|
# 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_SERVER/sql/g' MsSetup.inc
|
||||||
RUN sed -i -e 's/TARGET_DATABASE/msphpsql_pdosqlsrv/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_USERNAME/'"$TEST_PHP_SQL_UID"'/g' MsSetup.inc
|
||||||
RUN sed -i -e 's/TARGET_PASSWORD/'"$TEST_PHP_SQL_PWD"'/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_SERVER/sql/g' MsSetup.inc
|
||||||
RUN sed -i -e 's/TARGET_DATABASE/msphpsql_sqlsrv/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
|
RUN sed -i -e 's/TARGET_USERNAME/'"$TEST_PHP_SQL_UID"'/g' MsSetup.inc
|
||||||
|
|
18
appveyor.yml
18
appveyor.yml
|
@ -123,10 +123,10 @@ install:
|
||||||
- 7z x -y php-sdk-binary-tools-20110915.zip -o%PHP_SDK%
|
- 7z x -y php-sdk-binary-tools-20110915.zip -o%PHP_SDK%
|
||||||
- 7z x -y php.zip -o%PHP_SDK_DIR%
|
- 7z x -y php.zip -o%PHP_SDK_DIR%
|
||||||
- echo update SQL connection string
|
- 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\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\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\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\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\sqlsrv\MsSetup.inc
|
- ps: Get-Content ${env:APPVEYOR_BUILD_FOLDER}\test\functional\sqlsrv\MsSetup.inc
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- '"C:\\Program Files (x86)\\Microsoft Visual Studio %PHP_VC%.0\\VC\\vcvarsall.bat" %BUILD_PLATFORM%'
|
- '"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%
|
- python %APPVEYOR_BUILD_FOLDER%\test\setup\setup_dbs.py -dbname %SQLSRV_DBNAME%
|
||||||
- Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME%
|
- Echo setup test database for PDO_SQLSRV tests - %PDOSQLSRV_DBNAME%
|
||||||
- python %APPVEYOR_BUILD_FOLDER%\test\setup\setup_dbs.py -dbname %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
|
- 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\sqlsrv.log
|
- type %APPVEYOR_BUILD_FOLDER%\test\functional\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
|
- 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\pdo_sqlsrv.log
|
- 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 %SQLSRV_DBNAME%
|
||||||
- python %APPVEYOR_BUILD_FOLDER%\test\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME%
|
- python %APPVEYOR_BUILD_FOLDER%\test\setup\cleanup_dbs.py -dbname %PDOSQLSRV_DBNAME%
|
||||||
|
|
||||||
after_test:
|
after_test:
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%\test\
|
- cd %APPVEYOR_BUILD_FOLDER%\test\functional\
|
||||||
- python output.py
|
- python output.py
|
||||||
- ps: $difffiles = Get-ChildItem sqlsrv\*.diff
|
- ps: $difffiles = Get-ChildItem sqlsrv\*.diff
|
||||||
- ps: $outfiles = Get-ChildItem sqlsrv\*.out
|
- ps: $outfiles = Get-ChildItem sqlsrv\*.out
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Connection option APP name unicode
|
Connection option APP name unicode
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif.inc'); ?>
|
<?php require('skipif.inc'); ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
|
|
||||||
$appName = "APP_PoP_银河";
|
$appName = "APP_PoP_银河";
|
||||||
|
|
||||||
// Connect
|
// Connect
|
||||||
$conn = new PDO("sqlsrv:server=$server;APP=$appName","$uid","$pwd");
|
$conn = new PDO("sqlsrv:server=$server;APP=$appName","$uid","$pwd");
|
||||||
|
|
||||||
// Query and Fetch
|
// Query and Fetch
|
||||||
$query = "SELECT APP_NAME()";
|
$query = "SELECT APP_NAME()";
|
||||||
|
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
while ( $row = $stmt->fetch(PDO::FETCH_NUM) ){
|
while ( $row = $stmt->fetch(PDO::FETCH_NUM) ){
|
||||||
echo $row[0]."\n";
|
echo $row[0]."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ){
|
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ){
|
||||||
echo $row['']."\n";
|
echo $row['']."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the connection
|
// Free the connection
|
||||||
$conn=null;
|
$conn=null;
|
||||||
echo "Done"
|
echo "Done"
|
||||||
?>
|
?>
|
||||||
|
|
||||||
--EXPECTREGEX--
|
--EXPECTREGEX--
|
||||||
APP_PoP_银河
|
APP_PoP_银河
|
||||||
APP_PoP_银河
|
APP_PoP_银河
|
||||||
Done
|
Done
|
|
@ -1,50 +1,50 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Insert with quoted parameters
|
Insert with quoted parameters
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif.inc'); ?>
|
<?php require('skipif.inc'); ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
|
|
||||||
// Connect
|
// Connect
|
||||||
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
|
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
|
||||||
|
|
||||||
$param = 'a \' g';
|
$param = 'a \' g';
|
||||||
$param2 = $conn->quote( $param );
|
$param2 = $conn->quote( $param );
|
||||||
|
|
||||||
// Create a temporary table
|
// Create a temporary table
|
||||||
$tableName = '#tmpTable';
|
$tableName = '#tmpTable';
|
||||||
$query = "CREATE TABLE $tableName (col1 VARCHAR(10), col2 VARCHAR(20))";
|
$query = "CREATE TABLE $tableName (col1 VARCHAR(10), col2 VARCHAR(20))";
|
||||||
$stmt = $conn->exec($query);
|
$stmt = $conn->exec($query);
|
||||||
if( $stmt === false ) { die(); }
|
if( $stmt === false ) { die(); }
|
||||||
|
|
||||||
// Inserd data
|
// Inserd data
|
||||||
$query = "INSERT INTO $tableName VALUES( ?, '1' )";
|
$query = "INSERT INTO $tableName VALUES( ?, '1' )";
|
||||||
$stmt = $conn->prepare( $query );
|
$stmt = $conn->prepare( $query );
|
||||||
$stmt->execute(array($param));
|
$stmt->execute(array($param));
|
||||||
|
|
||||||
// Inserd data
|
// Inserd data
|
||||||
$query = "INSERT INTO $tableName VALUES( ?, ? )";
|
$query = "INSERT INTO $tableName VALUES( ?, ? )";
|
||||||
$stmt = $conn->prepare( $query );
|
$stmt = $conn->prepare( $query );
|
||||||
$stmt->execute(array($param, $param2));
|
$stmt->execute(array($param, $param2));
|
||||||
|
|
||||||
// Query
|
// Query
|
||||||
$query = "SELECT * FROM $tableName";
|
$query = "SELECT * FROM $tableName";
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
while ( $row = $stmt->fetch( PDO::FETCH_ASSOC ) ){
|
while ( $row = $stmt->fetch( PDO::FETCH_ASSOC ) ){
|
||||||
print_r( $row['col1'] ." was inserted\n" );
|
print_r( $row['col1'] ." was inserted\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Revert the inserts
|
// Revert the inserts
|
||||||
$query = "delete from $tableName where col1 = ?";
|
$query = "delete from $tableName where col1 = ?";
|
||||||
$stmt = $conn->prepare( $query );
|
$stmt = $conn->prepare( $query );
|
||||||
$stmt->execute(array($param));
|
$stmt->execute(array($param));
|
||||||
|
|
||||||
//free the statement and connection
|
//free the statement and connection
|
||||||
$stmt=null;
|
$stmt=null;
|
||||||
$conn=null;
|
$conn=null;
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
a ' g was inserted
|
a ' g was inserted
|
||||||
a ' g was inserted
|
a ' g was inserted
|
||||||
|
|
|
@ -1,56 +1,56 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Number of rows in a result set
|
Number of rows in a result set
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php require('skipif.inc'); ?>
|
<?php require('skipif.inc'); ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
require_once("MsSetup.inc");
|
require_once("MsSetup.inc");
|
||||||
|
|
||||||
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
|
$conn = new PDO( "sqlsrv:server=$server; database=$databaseName", "$uid", "$pwd" );
|
||||||
|
|
||||||
// Create table
|
// Create table
|
||||||
$tableName = '#tmpTable1';
|
$tableName = '#tmpTable1';
|
||||||
$stmt = $conn->exec("CREATE TABLE $tableName (c1 VARCHAR(32))");
|
$stmt = $conn->exec("CREATE TABLE $tableName (c1 VARCHAR(32))");
|
||||||
$stmt=null;
|
$stmt=null;
|
||||||
|
|
||||||
// Insert data
|
// Insert data
|
||||||
$query = "INSERT INTO $tableName VALUES ('Salmon'),('Butterfish'),('Cod'),('NULL'),('Crab')";
|
$query = "INSERT INTO $tableName VALUES ('Salmon'),('Butterfish'),('Cod'),('NULL'),('Crab')";
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
$res[] = $stmt->rowCount();
|
$res[] = $stmt->rowCount();
|
||||||
|
|
||||||
// Update data
|
// Update data
|
||||||
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='Cod'";
|
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='Cod'";
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
$res[] = $stmt->rowCount();
|
$res[] = $stmt->rowCount();
|
||||||
|
|
||||||
// Update data
|
// Update data
|
||||||
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NULL'";
|
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NULL'";
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
$res[] = $stmt->rowCount();
|
$res[] = $stmt->rowCount();
|
||||||
|
|
||||||
// Update data
|
// Update data
|
||||||
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NO_NAME'";
|
$query = "UPDATE $tableName SET c1='Salmon' WHERE c1='NO_NAME'";
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
$res[] = $stmt->rowCount();
|
$res[] = $stmt->rowCount();
|
||||||
|
|
||||||
// Update data
|
// Update data
|
||||||
$query = "UPDATE $tableName SET c1='N/A'";
|
$query = "UPDATE $tableName SET c1='N/A'";
|
||||||
$stmt = $conn->query($query);
|
$stmt = $conn->query($query);
|
||||||
$res[] = $stmt->rowCount();
|
$res[] = $stmt->rowCount();
|
||||||
|
|
||||||
print_r($res);
|
print_r($res);
|
||||||
|
|
||||||
$stmt=null;
|
$stmt=null;
|
||||||
$conn=null;
|
$conn=null;
|
||||||
print "Done"
|
print "Done"
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
Array
|
Array
|
||||||
(
|
(
|
||||||
[0] => 5
|
[0] => 5
|
||||||
[1] => 1
|
[1] => 1
|
||||||
[2] => 1
|
[2] => 1
|
||||||
[3] => 0
|
[3] => 0
|
||||||
[4] => 5
|
[4] => 5
|
||||||
)
|
)
|
||||||
Done
|
Done
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue