Updated app to PHP7.3 min supported version, For php8 support

- Updated remaining dependancies
- Upped min versions used
- Updated GH actions to drop 7.2 and include 8.0
- Updated phpunit & tests to 9.x
This commit is contained in:
Dan Brown 2021-03-20 15:35:39 +00:00
parent 44a293f051
commit 829fecd338
9 changed files with 827 additions and 504 deletions

View File

@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
php: [7.2, 7.3, 7.4] php: [7.3, 7.4, 8.0]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1

View File

@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
php: [7.2, 7.3, 7.4] php: [7.3, 7.4, 8.0]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1

View File

@ -5,7 +5,7 @@
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
"php": "^7.2.5", "php": "^7.3|^8.0",
"ext-curl": "*", "ext-curl": "*",
"ext-dom": "*", "ext-dom": "*",
"ext-gd": "*", "ext-gd": "*",
@ -14,7 +14,7 @@
"ext-xml": "*", "ext-xml": "*",
"barryvdh/laravel-dompdf": "^0.8.7", "barryvdh/laravel-dompdf": "^0.8.7",
"barryvdh/laravel-snappy": "^0.4.8", "barryvdh/laravel-snappy": "^0.4.8",
"doctrine/dbal": "^2.9", "doctrine/dbal": "^2.12.1",
"facade/ignition": "^1.16.4", "facade/ignition": "^1.16.4",
"fideloper/proxy": "^4.4.1", "fideloper/proxy": "^4.4.1",
"intervention/image": "^2.5.1", "intervention/image": "^2.5.1",
@ -23,7 +23,7 @@
"league/commonmark": "^1.5", "league/commonmark": "^1.5",
"league/flysystem-aws-s3-v3": "^1.0.29", "league/flysystem-aws-s3-v3": "^1.0.29",
"nunomaduro/collision": "^3.1", "nunomaduro/collision": "^3.1",
"onelogin/php-saml": "^3.3", "onelogin/php-saml": "^4.0",
"predis/predis": "^1.1.6", "predis/predis": "^1.1.6",
"socialiteproviders/discord": "^4.1", "socialiteproviders/discord": "^4.1",
"socialiteproviders/gitlab": "^4.1", "socialiteproviders/gitlab": "^4.1",
@ -36,10 +36,10 @@
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.5.1", "barryvdh/laravel-debugbar": "^3.5.1",
"barryvdh/laravel-ide-helper": "^2.8.2", "barryvdh/laravel-ide-helper": "^2.8.2",
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.13.0",
"laravel/browser-kit-testing": "^5.2", "laravel/browser-kit-testing": "^5.2",
"mockery/mockery": "^1.3.3", "mockery/mockery": "^1.3.3",
"phpunit/phpunit": "^8.0", "phpunit/phpunit": "^9.5.3",
"squizlabs/php_codesniffer": "^3.5.8" "squizlabs/php_codesniffer": "^3.5.8"
}, },
"autoload": { "autoload": {
@ -87,7 +87,7 @@
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true, "sort-packages": true,
"platform": { "platform": {
"php": "7.2.5" "php": "7.3.0"
} }
}, },
"extra": { "extra": {

1199
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
FROM php:7.3-apache FROM php:7.4-apache
ENV APACHE_DOCUMENT_ROOT /app/public ENV APACHE_DOCUMENT_ROOT /app/public
WORKDIR /app WORKDIR /app
@ -6,7 +6,7 @@ WORKDIR /app
RUN apt-get update -y \ RUN apt-get update -y \
&& apt-get install -y git zip unzip libtidy-dev libpng-dev libldap2-dev libxml++2.6-dev wait-for-it \ && apt-get install -y git zip unzip libtidy-dev libpng-dev libldap2-dev libxml++2.6-dev wait-for-it \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \ && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-install pdo pdo_mysql tidy dom xml mbstring gd ldap \ && docker-php-ext-install pdo pdo_mysql dom xml mbstring gd ldap \
&& a2enmod rewrite \ && a2enmod rewrite \
&& sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \ && sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \ && sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false" backupStaticAttributes="false"
bootstrap="vendor/autoload.php" bootstrap="vendor/autoload.php"
colors="true" colors="true"
@ -8,55 +10,55 @@
convertWarningsToExceptions="true" convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false"> stopOnFailure="false">
<testsuites> <coverage>
<testsuite name="Application Test Suite"> <include>
<directory>./tests/</directory> <directory suffix=".php">app/</directory>
</testsuite> </include>
</testsuites> </coverage>
<filter> <testsuites>
<whitelist> <testsuite name="Application Test Suite">
<directory suffix=".php">app/</directory> <directory>./tests/</directory>
</whitelist> </testsuite>
</filter> </testsuites>
<php> <php>
<server name="APP_ENV" value="testing"/> <server name="APP_ENV" value="testing"/>
<server name="APP_DEBUG" value="false"/> <server name="APP_DEBUG" value="false"/>
<server name="APP_LANG" value="en"/> <server name="APP_LANG" value="en"/>
<server name="APP_THEME" value="none"/> <server name="APP_THEME" value="none"/>
<server name="APP_AUTO_LANG_PUBLIC" value="true"/> <server name="APP_AUTO_LANG_PUBLIC" value="true"/>
<server name="APP_URL" value="http://bookstack.dev"/> <server name="APP_URL" value="http://bookstack.dev"/>
<server name="ALLOWED_IFRAME_HOSTS" value=""/> <server name="ALLOWED_IFRAME_HOSTS" value=""/>
<server name="CACHE_DRIVER" value="array"/> <server name="CACHE_DRIVER" value="array"/>
<server name="SESSION_DRIVER" value="array"/> <server name="SESSION_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/> <server name="QUEUE_CONNECTION" value="sync"/>
<server name="DB_CONNECTION" value="mysql_testing"/> <server name="DB_CONNECTION" value="mysql_testing"/>
<server name="BCRYPT_ROUNDS" value="4"/> <server name="BCRYPT_ROUNDS" value="4"/>
<server name="MAIL_DRIVER" value="array"/> <server name="MAIL_DRIVER" value="array"/>
<server name="LOG_CHANNEL" value="single"/> <server name="LOG_CHANNEL" value="single"/>
<server name="AUTH_METHOD" value="standard"/> <server name="AUTH_METHOD" value="standard"/>
<server name="DISABLE_EXTERNAL_SERVICES" value="true"/> <server name="DISABLE_EXTERNAL_SERVICES" value="true"/>
<server name="AVATAR_URL" value=""/> <server name="AVATAR_URL" value=""/>
<server name="LDAP_START_TLS" value="false"/> <server name="LDAP_START_TLS" value="false"/>
<server name="LDAP_VERSION" value="3"/> <server name="LDAP_VERSION" value="3"/>
<server name="SESSION_SECURE_COOKIE" value="null"/> <server name="SESSION_SECURE_COOKIE" value="null"/>
<server name="STORAGE_TYPE" value="local"/> <server name="STORAGE_TYPE" value="local"/>
<server name="STORAGE_ATTACHMENT_TYPE" value="local"/> <server name="STORAGE_ATTACHMENT_TYPE" value="local"/>
<server name="STORAGE_IMAGE_TYPE" value="local"/> <server name="STORAGE_IMAGE_TYPE" value="local"/>
<server name="GITHUB_APP_ID" value="aaaaaaaaaaaaaa"/> <server name="GITHUB_APP_ID" value="aaaaaaaaaaaaaa"/>
<server name="GITHUB_APP_SECRET" value="aaaaaaaaaaaaaa"/> <server name="GITHUB_APP_SECRET" value="aaaaaaaaaaaaaa"/>
<server name="GITHUB_AUTO_REGISTER" value=""/> <server name="GITHUB_AUTO_REGISTER" value=""/>
<server name="GITHUB_AUTO_CONFIRM_EMAIL" value=""/> <server name="GITHUB_AUTO_CONFIRM_EMAIL" value=""/>
<server name="GOOGLE_APP_ID" value="aaaaaaaaaaaaaa"/> <server name="GOOGLE_APP_ID" value="aaaaaaaaaaaaaa"/>
<server name="GOOGLE_APP_SECRET" value="aaaaaaaaaaaaaa"/> <server name="GOOGLE_APP_SECRET" value="aaaaaaaaaaaaaa"/>
<server name="GOOGLE_AUTO_REGISTER" value=""/> <server name="GOOGLE_AUTO_REGISTER" value=""/>
<server name="GOOGLE_AUTO_CONFIRM_EMAIL" value=""/> <server name="GOOGLE_AUTO_CONFIRM_EMAIL" value=""/>
<server name="GOOGLE_SELECT_ACCOUNT" value=""/> <server name="GOOGLE_SELECT_ACCOUNT" value=""/>
<server name="DEBUGBAR_ENABLED" value="false"/> <server name="DEBUGBAR_ENABLED" value="false"/>
<server name="SAML2_ENABLED" value="false"/> <server name="SAML2_ENABLED" value="false"/>
<server name="API_REQUESTS_PER_MIN" value="180"/> <server name="API_REQUESTS_PER_MIN" value="180"/>
<server name="LOG_FAILED_LOGIN_MESSAGE" value=""/> <server name="LOG_FAILED_LOGIN_MESSAGE" value=""/>
<server name="LOG_FAILED_LOGIN_CHANNEL" value="testing"/> <server name="LOG_FAILED_LOGIN_CHANNEL" value="testing"/>
<server name="WKHTMLTOPDF" value="false"/> <server name="WKHTMLTOPDF" value="false"/>
<server name="APP_DEFAULT_DARK_MODE" value="false"/> <server name="APP_DEFAULT_DARK_MODE" value="false"/>
</php> </php>
</phpunit> </phpunit>

View File

@ -119,7 +119,7 @@ abstract class BrowserKitTest extends TestCase
*/ */
protected function seeInNthElement($element, $position, $text, $negate = false) protected function seeInNthElement($element, $position, $text, $negate = false)
{ {
$method = $negate ? 'assertNotRegExp' : 'assertRegExp'; $method = $negate ? 'assertDoesNotMatchRegularExpression' : 'assertMatchesRegularExpression';
$rawPattern = preg_quote($text, '/'); $rawPattern = preg_quote($text, '/');

View File

@ -162,7 +162,7 @@ class EntityTest extends BrowserKitTest
->press('Save Book'); ->press('Save Book');
$expectedPattern = '/\/books\/my-first-book-[0-9a-zA-Z]{3}/'; $expectedPattern = '/\/books\/my-first-book-[0-9a-zA-Z]{3}/';
$this->assertRegExp($expectedPattern, $this->currentUri, "Did not land on expected page [$expectedPattern].\n"); $this->assertMatchesRegularExpression($expectedPattern, $this->currentUri, "Did not land on expected page [$expectedPattern].\n");
$book = Book::where('slug', '=', 'my-first-book')->first(); $book = Book::where('slug', '=', 'my-first-book')->first();
return $book; return $book;

View File

@ -184,7 +184,7 @@ class ImageTest extends TestCase
$this->assertEquals('bad.phtml.png', $lastImage->name); $this->assertEquals('bad.phtml.png', $lastImage->name);
$this->assertEquals('bad-phtml.png', basename($lastImage->path)); $this->assertEquals('bad-phtml.png', basename($lastImage->path));
$this->assertFileNotExists(public_path($relPath), 'Uploaded image file name was not stripped of dots'); $this->assertFileDoesNotExist(public_path($relPath), 'Uploaded image file name was not stripped of dots');
$this->assertFileExists(public_path($expectedRelPath)); $this->assertFileExists(public_path($expectedRelPath));
$this->deleteImage($lastImage->path); $this->deleteImage($lastImage->path);