Skip to content

Commit 46661ca

Browse files
committed
Test SQLite installation authorization
Run dedicated WordPress PHPUnit coverage in single-site and multisite modes. Verify subsite administrators cannot reach the UI or mutation path even with a valid nonce, while administrators and super administrators retain their expected access.
1 parent 562881a commit 46661ca

6 files changed

Lines changed: 455 additions & 0 deletions

File tree

‎.github/workflows/wp-tests-phpunit.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
- name: Run WordPress PHPUnit tests
3434
run: node .github/workflows/wp-tests-phpunit-run.js
3535

36+
- name: Run SQLite plugin single-site PHPUnit tests
37+
run: composer run wp-test-plugin-php
38+
39+
- name: Run SQLite plugin multisite PHPUnit tests
40+
run: composer run wp-test-plugin-php-multisite
41+
3642
- name: Stop Docker containers
3743
if: always()
3844
run: composer run wp-test-clean

‎AGENTS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ composer run test -- --filter testName # Run specific unit test class/method
4848
# SQLite Database Integration plugin E2E tests
4949
composer run test-e2e # Run E2E tests (Playwright via WP env)
5050

51+
# SQLite Database Integration plugin PHPUnit tests
52+
composer run wp-test-plugin-php # Run single-site plugin tests
53+
composer run wp-test-plugin-php-multisite # Run multisite plugin tests
54+
5155
# WordPress tests
5256
composer run wp-setup # Set up WordPress with SQLite for tests
5357
composer run wp-run # Run a WordPress repository command

‎README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ composer run test -- --filter testName # Run specific unit test class/method
4646
# SQLite Database Integration plugin E2E tests
4747
composer run test-e2e # Run E2E tests (Playwright via WP env)
4848

49+
# SQLite Database Integration plugin PHPUnit tests
50+
composer run wp-test-plugin-php # Run single-site plugin tests
51+
composer run wp-test-plugin-php-multisite # Run multisite plugin tests
52+
4953
# WordPress tests
5054
composer run wp-setup # Set up WordPress with SQLite for tests
5155
composer run wp-run # Run a WordPress repository command

‎composer.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@
6969
"rm -rf wordpress/src/wp-content/database/.ht.sqlite @no_additional_args",
7070
"npm --prefix wordpress run test:php -- @additional_args"
7171
],
72+
"wp-test-plugin-php": [
73+
"@wp-test-php tests/phpunit/plugin-sqlite-database-integration/authorization.php"
74+
],
75+
"wp-test-plugin-php-multisite": [
76+
"@wp-test-php -c tests/phpunit/multisite.xml tests/phpunit/plugin-sqlite-database-integration/authorization.php"
77+
],
7278
"wp-test-e2e": [
7379
"@wp-test-ensure-env @no_additional_args",
7480
"npm --prefix wordpress run test:e2e -- @additional_args"

0 commit comments

Comments
 (0)