Skip to content

Commit 1be2969

Browse files
committed
Dev: Set timezone for test DB creation, added PHP 8.5 to tests
Also fixed some test namespaces Related to #5881
1 parent 99a1d82 commit 1be2969

File tree

8 files changed

+9
-11
lines changed

8 files changed

+9
-11
lines changed

.github/workflows/test-migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-24.04
1717
strategy:
1818
matrix:
19-
php: ['8.2', '8.3', '8.4']
19+
php: ['8.2', '8.3', '8.4', '8.5']
2020
steps:
2121
- uses: actions/checkout@v4
2222

.github/workflows/test-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-24.04
1717
strategy:
1818
matrix:
19-
php: ['8.2', '8.3', '8.4']
19+
php: ['8.2', '8.3', '8.4', '8.5']
2020
steps:
2121
- uses: actions/checkout@v4
2222

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"@php artisan view:clear"
9494
],
9595
"refresh-test-database": [
96+
"@putenv APP_TIMEZONE=UTC",
9697
"@php artisan migrate:refresh --database=mysql_testing",
9798
"@php artisan db:seed --class=DummyContentSeeder --database=mysql_testing"
9899
]

database/seeders/DummyContentSeeder.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use BookStack\Users\Models\Role;
1414
use BookStack\Users\Models\User;
1515
use Illuminate\Database\Eloquent\Relations\HasMany;
16-
use Illuminate\Database\Eloquent\Relations\Relation;
1716
use Illuminate\Database\Seeder;
1817
use Illuminate\Support\Collection;
1918
use Illuminate\Support\Facades\Hash;
@@ -23,10 +22,8 @@ class DummyContentSeeder extends Seeder
2322
{
2423
/**
2524
* Run the database seeds.
26-
*
27-
* @return void
2825
*/
29-
public function run()
26+
public function run(): void
3027
{
3128
// Create an editor user
3229
$editorUser = User::factory()->create();

dev/docs/development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ When it's time for a release the `development` branch is merged into release wit
77

88
## Building CSS & JavaScript Assets
99

10-
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:
10+
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:
1111

1212
``` bash
1313
# Install NPM Dependencies
@@ -113,4 +113,4 @@ docker-compose run app php vendor/bin/phpunit
113113
### Debugging
114114

115115
The docker-compose setup ships with Xdebug, which you can listen to on port 9090.
116-
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.
116+
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.

dev/docs/php-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BookStack has many test cases defined within the `tests/` directory of the app.
44

55
## Setup
66

7-
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:
7+
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:
88

99
- Host: `127.0.0.1`
1010
- Username: `bookstack-test`

tests/Activity/CommentsApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Activity;
3+
namespace Tests\Activity;
44

55
use BookStack\Activity\Models\Comment;
66
use BookStack\Permissions\Permission;

tests/Entity/EntityQueryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Entity;
3+
namespace Tests\Entity;
44

55
use BookStack\Entities\Models\Book;
66
use Illuminate\Database\Eloquent\Builder;

0 commit comments

Comments
 (0)