Skip to content

Commit 3162e4f

Browse files
joehoyleclaude
andcommitted
Create test database automatically in composer test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f768054 commit 3162e4f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
"yoast/phpunit-polyfills": "^2.0"
1919
},
2020
"scripts": {
21-
"test": "phpunit"
21+
"test": [
22+
"@test:db",
23+
"phpunit"
24+
],
25+
"test:db": "mysql -u \"${WP_TESTS_DB_USER:-root}\" -h \"${WP_TESTS_DB_HOST:-localhost}\" -e \"CREATE DATABASE IF NOT EXISTS ${WP_TESTS_DB_NAME:-foundry_tests}\""
2226
},
2327
"config": {
2428
"allow-plugins": {

0 commit comments

Comments
 (0)