aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerky <derky@phpbb.com>2018-01-11 21:02:12 +0100
committerDerky <derky@phpbb.com>2018-01-11 21:02:12 +0100
commit500cd2916e06c753a815b77b6c0421b6d33bc179 (patch)
treef5ccaa8c5d8249b921889f0359814e89b27b1d82
parentf26cf2dc1f2c58ac6cf97974aafa749688cacbaa (diff)
parent6a75fe26fc80e1ffab0242ea6c2e9d1c1ef7d7c7 (diff)
downloadforums-500cd2916e06c753a815b77b6c0421b6d33bc179.tar
forums-500cd2916e06c753a815b77b6c0421b6d33bc179.tar.gz
forums-500cd2916e06c753a815b77b6c0421b6d33bc179.tar.bz2
forums-500cd2916e06c753a815b77b6c0421b6d33bc179.tar.xz
forums-500cd2916e06c753a815b77b6c0421b6d33bc179.zip
Merge pull request #5080 from marc1706/ticket/15055
[ticket/15055] Display content on unexpted server error
-rw-r--r--.appveyor.yml24
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php7
2 files changed, 20 insertions, 11 deletions
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("<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
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');
}