1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-23 00:50:30 +01:00

Merge pull request #5080 from marc1706/ticket/15055

[ticket/15055] Display content on unexpted server error
This commit is contained in:
Derky 2018-01-11 21:02:12 +01:00
commit 500cd2916e
2 changed files with 20 additions and 11 deletions

View File

@ -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("<configuration>", "<configuration>`n`t<system.web>`n`t`t<customErrors mode=`"Off`"/>`n`t</system.web>") | Set-Content c:\projects\phpbb\phpBB\web.config
(Get-Content c:\projects\phpbb\phpBB\web.config).replace("`t</system.webServer>", "`t`t<httpErrors errorMode=`"Detailed`" />`n`t</system.webServer>") | Set-Content c:\projects\phpbb\phpBB\web.config
- cd c:\projects\phpbb\phpBB
- php ..\composer.phar install
- choco install -y urlrewrite

View File

@ -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');
}