Skip to content

Commit f2cbeda

Browse files
authored
Merge pull request #58 from Metadrop/claude/add-create-database-check-011CV2fVZnrh6vzNXxxchrW1
Add validation check for create-database command
2 parents fe7da17 + 82124a9 commit f2cbeda

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test.bats

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,23 @@ check_drupal_admin_access() {
225225
rm -f /tmp/cookies_$$
226226
}
227227

228+
229+
check_create_database_command() {
230+
231+
local DB_NAME="secondary"
232+
233+
echo -n "Checking if create-database command works..."
234+
run ddev create-database $DB_NAME
235+
assert_success
236+
echo " Ok."
237+
238+
echo -n "Checking if new created database is accessible..."
239+
run bats_pipe echo "SHOW TABLES;" \| ddev mysql --database="$DB_NAME"
240+
assert_success
241+
echo " Ok."
242+
243+
}
244+
228245
@test "install from directory" {
229246
set -eu -o pipefail
230247
cd "$TESTDIR"
@@ -257,4 +274,8 @@ check_drupal_admin_access() {
257274
# Check the project's homepage is accessible.
258275
check_project_homepage_is_browsable
259276
check_drupal_admin_access
277+
278+
# Check create-database command
279+
check_create_database_command
280+
260281
}

0 commit comments

Comments
 (0)