NOW MANAGED ON CODEBERG
Dev: Set timezone for test DB creation, added PHP 8.5 to tests
Dan Brown1be2969055e0
diff --git a/.github/workflows/test-migrations.yml b/.github/workflows/test-migrations.ymlindex 23e58a772..80075c3f7 100644--- a/.github/workflows/test-migrations.yml+++ b/.github/workflows/test-migrations.yml@@ -16,7 +16,7 @@ jobs:runs-on: ubuntu-24.04strategy:matrix:- php: ['8.2', '8.3', '8.4']+ php: ['8.2', '8.3', '8.4', '8.5']steps:- uses: actions/checkout@v4diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.ymlindex 64132f673..5f4c16caf 100644--- a/.github/workflows/test-php.yml+++ b/.github/workflows/test-php.yml@@ -16,7 +16,7 @@ jobs:runs-on: ubuntu-24.04strategy:matrix:- php: ['8.2', '8.3', '8.4']+ php: ['8.2', '8.3', '8.4', '8.5']steps:- uses: actions/checkout@v4diff --git a/composer.json b/composer.jsonindex 2285a22cb..ab33e87a4 100644--- a/composer.json+++ b/composer.json@@ -93,6 +93,7 @@"@php artisan view:clear"],"refresh-test-database": [+ "@putenv APP_TIMEZONE=UTC","@php artisan migrate:refresh --database=mysql_testing","@php artisan db:seed --class=DummyContentSeeder --database=mysql_testing"]diff --git a/database/seeders/DummyContentSeeder.php b/database/seeders/DummyContentSeeder.phpindex 5f787259a..845bea8e4 100644--- a/database/seeders/DummyContentSeeder.php+++ b/database/seeders/DummyContentSeeder.php@@ -13,7 +13,6 @@ use BookStack\Search\SearchIndex;use BookStack\Users\Models\Role;use BookStack\Users\Models\User;use Illuminate\Database\Eloquent\Relations\HasMany;-use Illuminate\Database\Eloquent\Relations\Relation;use Illuminate\Database\Seeder;use Illuminate\Support\Collection;use Illuminate\Support\Facades\Hash;@@ -23,10 +22,8 @@ class DummyContentSeeder extends Seeder{/*** Run the database seeds.- *- * @return void*/- public function run()+ public function run(): void{// Create an editor user$editorUser = User::factory()->create();diff --git a/dev/docs/development.md b/dev/docs/development.mdindex ea3e692a1..6c250902a 100644--- a/dev/docs/development.md+++ b/dev/docs/development.md@@ -7,7 +7,7 @@ When it's time for a release the `development` branch is merged into release wit## Building CSS & JavaScript Assets-This project uses SASS for CSS development and this is built, along with the JavaScript, using a range of npm scripts. The below npm commands can be used to install the dependencies & run the build tasks:+This project uses SASS for CSS development which is built, along with the JavaScript, using a range of npm scripts. The below npm commands can be used to install the dependencies & run the build tasks:``` bash# Install NPM Dependencies@@ -113,4 +113,4 @@ docker-compose run app php vendor/bin/phpunit### DebuggingThe docker-compose setup ships with Xdebug, which you can listen to on port 9090.-NB : For some editors like Visual Studio Code, you might need to map your workspace folder to the /app folder within the docker container for this to work.+NB: For some editors like Visual Studio Code, you might need to map your workspace folder to the /app folder within the docker container for this to work.diff --git a/dev/docs/php-testing.md b/dev/docs/php-testing.mdindex 1bd4a414f..3d3e91fa2 100644--- a/dev/docs/php-testing.md+++ b/dev/docs/php-testing.md@@ -4,7 +4,7 @@ BookStack has many test cases defined within the `tests/` directory of the app.## Setup-The application tests are mostly functional, rather than unit tests, meaning they simulate user actions and system components and therefore these require use of the database. To avoid potential conflicts within your development environment, the tests use a separate database. This is defined via a specific `mysql_testing` database connection in our configuration, and expects to use the following database access details:+The application tests are mostly functional, rather than unit tests, meaning they simulate user actions and system components, and therefore these require use of the database. To avoid potential conflicts within your development environment, the tests use a separate database. This is defined via a specific `mysql_testing` database connection in our configuration, and expects to use the following database access details:- Host: `127.0.0.1`- Username: `bookstack-test`diff --git a/tests/Activity/CommentsApiTest.php b/tests/Activity/CommentsApiTest.phpindex ec4ddba99..51009da39 100644--- a/tests/Activity/CommentsApiTest.php+++ b/tests/Activity/CommentsApiTest.php@@ -1,6 +1,6 @@<?php-namespace Activity;+namespace Tests\Activity;use BookStack\Activity\Models\Comment;use BookStack\Permissions\Permission;diff --git a/tests/Entity/EntityQueryTest.php b/tests/Entity/EntityQueryTest.phpindex 7d3fd38ce..180cb3076 100644--- a/tests/Entity/EntityQueryTest.php+++ b/tests/Entity/EntityQueryTest.php@@ -1,6 +1,6 @@<?php-namespace Entity;+namespace Tests\Entity;use BookStack\Entities\Models\Book;use Illuminate\Database\Eloquent\Builder;