mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
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:
parent
44a293f051
commit
829fecd338
2
.github/workflows/phpunit.yml
vendored
2
.github/workflows/phpunit.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
php: [7.2, 7.3, 7.4]
|
||||
php: [7.3, 7.4, 8.0]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
|
2
.github/workflows/test-migrations.yml
vendored
2
.github/workflows/test-migrations.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
php: [7.2, 7.3, 7.4]
|
||||
php: [7.3, 7.4, 8.0]
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": "^7.2.5",
|
||||
"php": "^7.3|^8.0",
|
||||
"ext-curl": "*",
|
||||
"ext-dom": "*",
|
||||
"ext-gd": "*",
|
||||
@ -14,7 +14,7 @@
|
||||
"ext-xml": "*",
|
||||
"barryvdh/laravel-dompdf": "^0.8.7",
|
||||
"barryvdh/laravel-snappy": "^0.4.8",
|
||||
"doctrine/dbal": "^2.9",
|
||||
"doctrine/dbal": "^2.12.1",
|
||||
"facade/ignition": "^1.16.4",
|
||||
"fideloper/proxy": "^4.4.1",
|
||||
"intervention/image": "^2.5.1",
|
||||
@ -23,7 +23,7 @@
|
||||
"league/commonmark": "^1.5",
|
||||
"league/flysystem-aws-s3-v3": "^1.0.29",
|
||||
"nunomaduro/collision": "^3.1",
|
||||
"onelogin/php-saml": "^3.3",
|
||||
"onelogin/php-saml": "^4.0",
|
||||
"predis/predis": "^1.1.6",
|
||||
"socialiteproviders/discord": "^4.1",
|
||||
"socialiteproviders/gitlab": "^4.1",
|
||||
@ -36,10 +36,10 @@
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.5.1",
|
||||
"barryvdh/laravel-ide-helper": "^2.8.2",
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"fakerphp/faker": "^1.13.0",
|
||||
"laravel/browser-kit-testing": "^5.2",
|
||||
"mockery/mockery": "^1.3.3",
|
||||
"phpunit/phpunit": "^8.0",
|
||||
"phpunit/phpunit": "^9.5.3",
|
||||
"squizlabs/php_codesniffer": "^3.5.8"
|
||||
},
|
||||
"autoload": {
|
||||
@ -87,7 +87,7 @@
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"platform": {
|
||||
"php": "7.2.5"
|
||||
"php": "7.3.0"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
|
1199
composer.lock
generated
1199
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
FROM php:7.3-apache
|
||||
FROM php:7.4-apache
|
||||
|
||||
ENV APACHE_DOCUMENT_ROOT /app/public
|
||||
WORKDIR /app
|
||||
@ -6,7 +6,7 @@ WORKDIR /app
|
||||
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 \
|
||||
&& 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 \
|
||||
&& 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 \
|
||||
|
106
phpunit.xml
106
phpunit.xml
@ -1,5 +1,7 @@
|
||||
<?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"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
@ -8,55 +10,55 @@
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false">
|
||||
<testsuites>
|
||||
<testsuite name="Application Test Suite">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">app/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<server name="APP_ENV" value="testing"/>
|
||||
<server name="APP_DEBUG" value="false"/>
|
||||
<server name="APP_LANG" value="en"/>
|
||||
<server name="APP_THEME" value="none"/>
|
||||
<server name="APP_AUTO_LANG_PUBLIC" value="true"/>
|
||||
<server name="APP_URL" value="http://bookstack.dev"/>
|
||||
<server name="ALLOWED_IFRAME_HOSTS" value=""/>
|
||||
<server name="CACHE_DRIVER" value="array"/>
|
||||
<server name="SESSION_DRIVER" value="array"/>
|
||||
<server name="QUEUE_CONNECTION" value="sync"/>
|
||||
<server name="DB_CONNECTION" value="mysql_testing"/>
|
||||
<server name="BCRYPT_ROUNDS" value="4"/>
|
||||
<server name="MAIL_DRIVER" value="array"/>
|
||||
<server name="LOG_CHANNEL" value="single"/>
|
||||
<server name="AUTH_METHOD" value="standard"/>
|
||||
<server name="DISABLE_EXTERNAL_SERVICES" value="true"/>
|
||||
<server name="AVATAR_URL" value=""/>
|
||||
<server name="LDAP_START_TLS" value="false"/>
|
||||
<server name="LDAP_VERSION" value="3"/>
|
||||
<server name="SESSION_SECURE_COOKIE" value="null"/>
|
||||
<server name="STORAGE_TYPE" value="local"/>
|
||||
<server name="STORAGE_ATTACHMENT_TYPE" value="local"/>
|
||||
<server name="STORAGE_IMAGE_TYPE" value="local"/>
|
||||
<server name="GITHUB_APP_ID" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GITHUB_APP_SECRET" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GITHUB_AUTO_REGISTER" value=""/>
|
||||
<server name="GITHUB_AUTO_CONFIRM_EMAIL" value=""/>
|
||||
<server name="GOOGLE_APP_ID" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GOOGLE_APP_SECRET" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GOOGLE_AUTO_REGISTER" value=""/>
|
||||
<server name="GOOGLE_AUTO_CONFIRM_EMAIL" value=""/>
|
||||
<server name="GOOGLE_SELECT_ACCOUNT" value=""/>
|
||||
<server name="DEBUGBAR_ENABLED" value="false"/>
|
||||
<server name="SAML2_ENABLED" value="false"/>
|
||||
<server name="API_REQUESTS_PER_MIN" value="180"/>
|
||||
<server name="LOG_FAILED_LOGIN_MESSAGE" value=""/>
|
||||
<server name="LOG_FAILED_LOGIN_CHANNEL" value="testing"/>
|
||||
<server name="WKHTMLTOPDF" value="false"/>
|
||||
<server name="APP_DEFAULT_DARK_MODE" value="false"/>
|
||||
</php>
|
||||
<coverage>
|
||||
<include>
|
||||
<directory suffix=".php">app/</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
<testsuites>
|
||||
<testsuite name="Application Test Suite">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<server name="APP_ENV" value="testing"/>
|
||||
<server name="APP_DEBUG" value="false"/>
|
||||
<server name="APP_LANG" value="en"/>
|
||||
<server name="APP_THEME" value="none"/>
|
||||
<server name="APP_AUTO_LANG_PUBLIC" value="true"/>
|
||||
<server name="APP_URL" value="http://bookstack.dev"/>
|
||||
<server name="ALLOWED_IFRAME_HOSTS" value=""/>
|
||||
<server name="CACHE_DRIVER" value="array"/>
|
||||
<server name="SESSION_DRIVER" value="array"/>
|
||||
<server name="QUEUE_CONNECTION" value="sync"/>
|
||||
<server name="DB_CONNECTION" value="mysql_testing"/>
|
||||
<server name="BCRYPT_ROUNDS" value="4"/>
|
||||
<server name="MAIL_DRIVER" value="array"/>
|
||||
<server name="LOG_CHANNEL" value="single"/>
|
||||
<server name="AUTH_METHOD" value="standard"/>
|
||||
<server name="DISABLE_EXTERNAL_SERVICES" value="true"/>
|
||||
<server name="AVATAR_URL" value=""/>
|
||||
<server name="LDAP_START_TLS" value="false"/>
|
||||
<server name="LDAP_VERSION" value="3"/>
|
||||
<server name="SESSION_SECURE_COOKIE" value="null"/>
|
||||
<server name="STORAGE_TYPE" value="local"/>
|
||||
<server name="STORAGE_ATTACHMENT_TYPE" value="local"/>
|
||||
<server name="STORAGE_IMAGE_TYPE" value="local"/>
|
||||
<server name="GITHUB_APP_ID" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GITHUB_APP_SECRET" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GITHUB_AUTO_REGISTER" value=""/>
|
||||
<server name="GITHUB_AUTO_CONFIRM_EMAIL" value=""/>
|
||||
<server name="GOOGLE_APP_ID" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GOOGLE_APP_SECRET" value="aaaaaaaaaaaaaa"/>
|
||||
<server name="GOOGLE_AUTO_REGISTER" value=""/>
|
||||
<server name="GOOGLE_AUTO_CONFIRM_EMAIL" value=""/>
|
||||
<server name="GOOGLE_SELECT_ACCOUNT" value=""/>
|
||||
<server name="DEBUGBAR_ENABLED" value="false"/>
|
||||
<server name="SAML2_ENABLED" value="false"/>
|
||||
<server name="API_REQUESTS_PER_MIN" value="180"/>
|
||||
<server name="LOG_FAILED_LOGIN_MESSAGE" value=""/>
|
||||
<server name="LOG_FAILED_LOGIN_CHANNEL" value="testing"/>
|
||||
<server name="WKHTMLTOPDF" value="false"/>
|
||||
<server name="APP_DEFAULT_DARK_MODE" value="false"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
@ -119,7 +119,7 @@ abstract class BrowserKitTest extends TestCase
|
||||
*/
|
||||
protected function seeInNthElement($element, $position, $text, $negate = false)
|
||||
{
|
||||
$method = $negate ? 'assertNotRegExp' : 'assertRegExp';
|
||||
$method = $negate ? 'assertDoesNotMatchRegularExpression' : 'assertMatchesRegularExpression';
|
||||
|
||||
$rawPattern = preg_quote($text, '/');
|
||||
|
||||
|
@ -162,7 +162,7 @@ class EntityTest extends BrowserKitTest
|
||||
->press('Save Book');
|
||||
|
||||
$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();
|
||||
return $book;
|
||||
|
@ -184,7 +184,7 @@ class ImageTest extends TestCase
|
||||
|
||||
$this->assertEquals('bad.phtml.png', $lastImage->name);
|
||||
$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->deleteImage($lastImage->path);
|
||||
|
Loading…
Reference in New Issue
Block a user