diff --git a/.appveyor.yml b/.appveyor.yml index e536a561ff..a4fac799b2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,10 +15,10 @@ environment: php: 7.0 - db: mssql db_version: sql2016 - php: 7.0 - - db: mssql - db_version: sql2017 - php: 7.1 + php: 7.1.12 +# - db: mssql +# db_version: sql2017 +# php: 7.1 # - db: mariadb # php: 7.1 # - db: mysqli @@ -40,10 +40,10 @@ before_test: - ps: | Set-Service wuauserv -StartupType Manual cinst -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') - Get-ChildItem -Path "c:\tools\php$($env:php -replace '[.]','')" -Recurse | + Get-ChildItem -Path "c:\tools\php$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1$2')" -Recurse | Move-Item -destination "c:\tools\php" cd c:\tools\php - cat php.ini-production | %{$_ -replace "memory_limit = 128M","memory_limit = 1024M"} | Out-File -Encoding "Default" php.ini + cat php.ini-development | %{$_ -replace "memory_limit = 128M","memory_limit = 1024M"} | Out-File -Encoding "Default" php.ini Add-Content php.ini "`n date.timezone=UTC" Add-Content php.ini "`n display_errors=On" Add-Content php.ini "`n extension_dir=ext" @@ -64,10 +64,10 @@ before_test: if ($env:db -eq "mssql") { cd c:\tools\php\ext $DLLVersion = "4.1.6.1" - appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/sqlsrv/$($:DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip - 7z x -y php_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip > $null - appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip - 7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php)-nts-vc14-x64.zip > $null + appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/sqlsrv/$($:DLLVersion)/php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip + 7z x -y php_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip > $null + appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($DLLVersion)/php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip + 7z x -y php_pdo_sqlsrv-$($DLLVersion)-$($env:php -replace '([0-9])[.]([0-9])[.]?([0-9]+)?','$1.$2')-nts-vc14-x64.zip > $null Remove-Item c:\tools\php\* -include .zip cd c:\tools\php Add-Content php.ini "`nextension=php_sqlsrv.dll" @@ -114,6 +114,10 @@ before_test: # Install PhantomJS cinst -y phantomjs Start-Process "phantomjs" "--webdriver=8910" | Out-Null + - ps: | + cd c:\projects\phpbb\phpBB + (Get-Content c:\projects\phpbb\phpBB\web.config).replace("", "`n`t`n`t`t`n`t") | Set-Content c:\projects\phpbb\phpBB\web.config + (Get-Content c:\projects\phpbb\phpBB\web.config).replace("`t", "`t`t`n`t") | Set-Content c:\projects\phpbb\phpBB\web.config - cd c:\projects\phpbb\phpBB - php ..\composer.phar install - choco install -y urlrewrite diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 2be16c7198..e1daa4558a 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -911,10 +911,15 @@ class phpbb_functional_test_case extends phpbb_test_case * status code. This assertion tries to catch that. * * @param int $status_code Expected status code - * @return null + * @return void */ static public function assert_response_status_code($status_code = 200) { + if ($status_code != self::$client->getResponse()->getStatus() && + preg_match('/^5[0-9]{2}/', self::$client->getResponse()->getStatus())) + { + self::fail("Encountered unexpected server error:\n" . self::$client->getResponse()->getContent()); + } self::assertEquals($status_code, self::$client->getResponse()->getStatus(), 'HTTP status code does not match'); }