1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-11-23 17:22:23 +03:00

Dev: Set timezone for test DB creation, added PHP 8.5 to tests

Also fixed some test namespaces
Related to #5881
This commit is contained in:
Dan Brown
2025-11-18 19:47:41 +00:00
parent 99a1d82f0a
commit 1be2969055
8 changed files with 9 additions and 11 deletions

View File

@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
strategy: strategy:
matrix: matrix:
php: ['8.2', '8.3', '8.4'] php: ['8.2', '8.3', '8.4', '8.5']
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
strategy: strategy:
matrix: matrix:
php: ['8.2', '8.3', '8.4'] php: ['8.2', '8.3', '8.4', '8.5']
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -93,6 +93,7 @@
"@php artisan view:clear" "@php artisan view:clear"
], ],
"refresh-test-database": [ "refresh-test-database": [
"@putenv APP_TIMEZONE=UTC",
"@php artisan migrate:refresh --database=mysql_testing", "@php artisan migrate:refresh --database=mysql_testing",
"@php artisan db:seed --class=DummyContentSeeder --database=mysql_testing" "@php artisan db:seed --class=DummyContentSeeder --database=mysql_testing"
] ]

View File

@@ -13,7 +13,6 @@ use BookStack\Search\SearchIndex;
use BookStack\Users\Models\Role; use BookStack\Users\Models\Role;
use BookStack\Users\Models\User; use BookStack\Users\Models\User;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
@@ -23,10 +22,8 @@ class DummyContentSeeder extends Seeder
{ {
/** /**
* Run the database seeds. * Run the database seeds.
*
* @return void
*/ */
public function run() public function run(): void
{ {
// Create an editor user // Create an editor user
$editorUser = User::factory()->create(); $editorUser = User::factory()->create();

View File

@@ -7,7 +7,7 @@ When it's time for a release the `development` branch is merged into release wit
## Building CSS & JavaScript Assets ## 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 ``` bash
# Install NPM Dependencies # Install NPM Dependencies
@@ -113,4 +113,4 @@ docker-compose run app php vendor/bin/phpunit
### Debugging ### Debugging
The docker-compose setup ships with Xdebug, which you can listen to on port 9090. The 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.

View File

@@ -4,7 +4,7 @@ BookStack has many test cases defined within the `tests/` directory of the app.
## Setup ## 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` - Host: `127.0.0.1`
- Username: `bookstack-test` - Username: `bookstack-test`

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace Activity; namespace Tests\Activity;
use BookStack\Activity\Models\Comment; use BookStack\Activity\Models\Comment;
use BookStack\Permissions\Permission; use BookStack\Permissions\Permission;

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace Entity; namespace Tests\Entity;
use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Book;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;