Skip to content

Commit

Permalink
20230401 Fix CI build breakage. 6
Browse files Browse the repository at this point in the history
         Related Issue(s) #158 #159 #162 #163
  • Loading branch information
NathanGibbs3 committed Apr 2, 2023
1 parent 0691b86 commit 069ca68
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
21 changes: 16 additions & 5 deletions tests/php/idbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public function testbaseExecuteSQLWithLimitReturnsExpected(){
$sql = 'SELECT * FROM acid_event WHERE 1=2';
$this->assertInstanceOf( 'baseRS', $db->baseExecute($sql,1,4), $URV );
}
public function testbaseExecuteNULLSQLThrowsError(){
public function testbaseExecuteEmptySQLThrowsError(){
$db = self::$db;
$dbt = self::$dbt;
$sql = '';
Expand All @@ -420,7 +420,7 @@ public function testbaseExecuteNULLSQLThrowsError(){
}
$db->baseExecute($sql);
}
public function testbaseExecuteNULLSQLReturnsExpected(){
public function testbaseExecuteEmptySQLReturnsExpected(){
$db = self::$db;
$URV = self::$URV.'baseExecute().';
$sql = '';
Expand All @@ -444,11 +444,22 @@ public function testbaseExecuteInvalidSQLThrowsError(){
$this->expectException("PHPUnit_Framework_Error_Notice");
$this->expectExceptionMessage($EEM);
}elseif (version_compare($PHPUV, '9.0', '<')) { // PHPUnit 6x - 8x
$this->expectException("PHPUnit\Framework\Error\Notice");
$PHPV = GetPHPV();
if ( version_compare($PHPV, '8.0', '>=') ){
$this->expectException("PHPUnit\Framework\Error\Error");
}else{
$this->expectException("PHPUnit\Framework\Error\Notice");
}
$this->expectExceptionMessage($EEM);
}else{ // PHPUnit 9+
$this->expectNotice();
$this->expectNoticeMessage($EEM);
$PHPV = GetPHPV();
if ( version_compare($PHPV, '8.0', '>=') ){
$this->expectError();
$this->expectErrorMessage($EEM);
}else{
$this->expectNotice();
$this->expectNoticeMessage($EEM);
}
}
$db->baseExecute($sql);
}
Expand Down
21 changes: 17 additions & 4 deletions tests/setupenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,17 @@ ADOSrc=github.com/ADOdb/ADOdb
ADODl=archive
ADOFilePfx=v
ADOFileSfx=.tar.gz
GHMode=release
if [ "$pvM" \> "7" ]; then # PHP 8x
GHMode=branch
GHBranch=hotfix/5.22
ADODBVer=5.22.4
if [ "$1" == "" ] && [ "$TRAVIS" == "true" ]; then
ADODBPATH="ADOdb-$ADODBVer"
fi
elif [ "$pvM" \> "5" ]; then # PHP 7x
if [ "$pvm" \> "2" ]; then # PHP 7.3+
ADODBVer=5.22.2
ADODBVer=5.22.4
elif [ "$pvm" \> "1" ]; then # PHP 7.2+
ADODBVer=5.20.13
else
Expand All @@ -200,7 +203,7 @@ elif [ "$pvM" \> "5" ]; then # PHP 7x
fi
elif [ "$pvM" \> "4" ]; then # PHP 5x
if [ "$pvm" \> "2" ]; then # PHP 5.3+
ADODBVer=5.20.7
ADODBVer=5.20.8
else
ADODBVer=5.01beta
fi
Expand Down Expand Up @@ -242,8 +245,18 @@ else # PHP 4x
ADODBPATH="ADOdb-$ADODBVer/phplens/adodb"
fi
fi
ADOFile=$ADOFilePfx$ADODBVer$ADOFileSfx
echo "Setup PHP ADODB: $ADODBVer from: https://$ADOSrc"
echo -n "Setup PHP ADODB: "
if [ "$GHMode" == "release" ]; then
echo -n $ADODBVer
ADOFile=$ADOFilePfx$ADODBVer$ADOFileSfx
ADODl=archive
else # Branch Mode
echo -n "branch $GHBranch"
ADOFile=$GHBranch
ADODl=tarball
ADODBPATH=ADOdb-ADOdb-*
fi
echo " from: https://$ADOSrc"
if [ "$1" == "" ] && [ "$TRAVIS" == "true" ]; then
mkdir -p build/adodb
wget -nv https://$ADOSrc/$ADODl/$ADOFile -O build/adodb.tgz
Expand Down

0 comments on commit 069ca68

Please sign in to comment.