Skip to content

Commit e31cff3

Browse files
authored
Merge pull request #8 from iMattPro/tests
2 parents 48b8355 + dfc2e9f commit e31cff3

File tree

10 files changed

+1823
-27
lines changed

10 files changed

+1823
-27
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
tests/ export-ignore
22
.github/ export-ignore
3+
.node_modules/ export-ignore
34
.gitignore export-ignore
45
.gitattributes export-ignore
56
phpunit.xml.* export-ignore

.github/workflows/tests.yml

Lines changed: 69 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
include:
30-
- php: '7.2'
30+
- php: '7.3'
3131
db: "none"
3232
NOTESTS: 1
3333

@@ -95,24 +95,26 @@ jobs:
9595
strategy:
9696
matrix:
9797
include:
98-
- php: '7.2'
98+
- php: '7.3'
9999
db: "mariadb:10.1"
100-
- php: '7.2'
100+
- php: '7.3'
101101
db: "mariadb:10.2"
102-
- php: '7.2'
102+
- php: '7.3'
103103
db: "mariadb:10.3"
104-
- php: '7.2'
104+
- php: '7.3'
105105
db: "mariadb:10.4"
106-
- php: '7.2'
106+
- php: '7.3'
107107
db: "mariadb:10.5"
108-
- php: '7.2'
108+
- php: '7.3'
109+
db: "mysql:5.6"
110+
db_alias: "MySQL Slow Tests"
111+
SLOWTESTS: 1
112+
- php: '7.3'
109113
db: "mysql:5.6"
110114
db_alias: "MyISAM Tests"
111115
MYISAM: 1
112-
- php: '7.2'
116+
- php: '7.3'
113117
db: "mysql:5.6"
114-
- php: '7.2'
115-
db: "mysql:5.7"
116118
- php: '7.3'
117119
db: "mysql:5.7"
118120
- php: '7.4'
@@ -196,15 +198,40 @@ jobs:
196198
run: .github/setup-database.sh $DB $MYISAM
197199
working-directory: ./phpBB3
198200

201+
- name: Setup LDAP
202+
if: ${{ matrix.SLOWTESTS == 1 }}
203+
run: .github/setup-ldap.sh
204+
working-directory: ./phpBB3
205+
206+
- name: Setup node
207+
uses: actions/setup-node@v3
208+
with:
209+
node-version: 16
210+
- name: Setup node dependencies
211+
run: npm ci
212+
working-directory: ./phpBB3/phpBB/ext/phpbb/webpushnotifications
213+
214+
- name: Setup Extension
215+
run: composer install
216+
working-directory: ./phpBB3/phpBB/ext/phpbb/webpushnotifications
217+
199218
- name: Setup PHPUnit files
200219
run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_
201220
working-directory: ./phpBB3
202221

203222
- name: Run unit tests
223+
if: ${{ matrix.SLOWTESTS != 1 }}
204224
env:
205225
DB: ${{steps.database-type.outputs.db}}
206226
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php
207227
working-directory: ./phpBB3
228+
229+
- name: Slow tests
230+
env:
231+
DB: ${{steps.database-type.outputs.db}}
232+
if: ${{ matrix.SLOWTESTS == 1 }}
233+
run: phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/.github/phpunit-$DB-github.xml --bootstrap ./tests/bootstrap.php --group slow
234+
working-directory: ./phpBB3
208235
# END MySQL and MariaDB Job
209236

210237
# START PostgreSQL Job
@@ -213,18 +240,16 @@ jobs:
213240
strategy:
214241
matrix:
215242
include:
216-
- php: '7.2'
243+
- php: '7.3'
217244
db: "postgres:9.5"
218-
- php: '7.2'
245+
- php: '7.3'
219246
db: "postgres:9.6"
220-
- php: '7.2'
247+
- php: '7.3'
221248
db: "postgres:10"
222-
- php: '7.2'
249+
- php: '7.3'
223250
db: "postgres:11"
224-
- php: '7.2'
251+
- php: '7.3'
225252
db: "postgres:12"
226-
- php: '7.2'
227-
db: "postgres:13"
228253
- php: '7.3'
229254
db: "postgres:13"
230255
- php: '7.4'
@@ -310,6 +335,18 @@ jobs:
310335
run: .github/setup-database.sh $DB $MYISAM
311336
working-directory: ./phpBB3
312337

338+
- name: Setup node
339+
uses: actions/setup-node@v3
340+
with:
341+
node-version: 16
342+
- name: Setup node dependencies
343+
run: npm ci
344+
working-directory: ./phpBB3/phpBB/ext/phpbb/webpushnotifications
345+
346+
- name: Setup Extension
347+
run: composer install
348+
working-directory: ./phpBB3/phpBB/ext/phpbb/webpushnotifications
349+
313350
- name: Setup PHPUnit files
314351
run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_
315352
working-directory: ./phpBB3
@@ -327,12 +364,12 @@ jobs:
327364
strategy:
328365
matrix:
329366
include:
330-
- php: '7.2'
367+
- php: '7.3'
331368
db: "sqlite3"
332-
- php: '7.2'
369+
- php: '7.3'
333370
db: "mcr.microsoft.com/mssql/server:2017-latest"
334371
db_alias: 'MSSQL 2017'
335-
- php: '7.2'
372+
- php: '7.3'
336373
db: "mcr.microsoft.com/mssql/server:2019-latest"
337374
db_alias: 'MSSQL 2019'
338375

@@ -410,6 +447,18 @@ jobs:
410447
run: .github/setup-database.sh $DB $MYISAM
411448
working-directory: ./phpBB3
412449

450+
- name: Setup node
451+
uses: actions/setup-node@v3
452+
with:
453+
node-version: 16
454+
- name: Setup node dependencies
455+
run: npm ci
456+
working-directory: ./phpBB3/phpBB/ext/phpbb/webpushnotifications
457+
458+
- name: Setup Extension
459+
run: composer install
460+
working-directory: ./phpBB3/phpBB/ext/phpbb/webpushnotifications
461+
413462
- name: Setup PHPUnit files
414463
run: mkdir -p phpBB/ext/$EXTNAME/.github && cp .github/phpunit* $_
415464
working-directory: ./phpBB3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/build/
22
/vendor/
3+
/node_modules/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
],
2525
"require": {
26-
"php": ">=7.1.3",
26+
"php": ">=7.3",
2727
"composer/installers": "~1.0",
2828
"minishlink/web-push": "^7.0"
2929
},

config/services.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ services:
3030
- '@user'
3131
- '%core.root_path%'
3232
- '%core.php_ext%'
33-
- '%phpbb.wpn.tables.notification_push%'
34-
- '%phpbb.wpn.tables.push_subscriptions%'
33+
- '%tables.phpbb.wpn.notification_push%'
34+
- '%tables.phpbb.wpn.push_subscriptions%'
3535
tags:
3636
- { name: notification.method }
3737

@@ -46,6 +46,6 @@ services:
4646
- '@request'
4747
- '@user'
4848
- '@template.twig.environment'
49-
- '%phpbb.wpn.tables.notification_push%'
50-
- '%phpbb.wpn.tables.push_subscriptions%'
49+
- '%tables.phpbb.wpn.notification_push%'
50+
- '%tables.phpbb.wpn.push_subscriptions%'
5151

config/tables.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
parameters:
2-
phpbb.wpn.tables.notification_push: '%core.table_prefix%wpn_notification_push'
3-
phpbb.wpn.tables.push_subscriptions: '%core.table_prefix%wpn_push_subscriptions'
2+
tables.phpbb.wpn.notification_push: '%core.table_prefix%wpn_notification_push'
3+
tables.phpbb.wpn.push_subscriptions: '%core.table_prefix%wpn_push_subscriptions'

0 commit comments

Comments
 (0)