From 5ef107ced12099774082579b35c5848855dcff87 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Wed, 17 Jul 2024 15:53:43 -0600 Subject: [PATCH] fix: make phpmyadmin command work with nonstandard ports, fixes #19 (#20) --- commands/host/phpmyadmin | 5 ++--- tests/test.bats | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/commands/host/phpmyadmin b/commands/host/phpmyadmin index f780468..a1cdb80 100644 --- a/commands/host/phpmyadmin +++ b/commands/host/phpmyadmin @@ -7,9 +7,8 @@ DDEV_PHPMYADMIN_PORT=8036 DDEV_PHPMYADMIN_HTTPS_PORT=8037 - if [ ${DDEV_PRIMARY_URL%://*} = "http" ] || [ -n "${GITPOD_WORKSPACE_ID:-}" ] || [ "${CODESPACES:-}" = "true" ]; then - ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_PORT + ddev launch :$DDEV_PHPMYADMIN_PORT else - ddev launch $DDEV_PRIMARY_URL:$DDEV_PHPMYADMIN_HTTPS_PORT + ddev launch :$DDEV_PHPMYADMIN_HTTPS_PORT fi diff --git a/tests/test.bats b/tests/test.bats index 1a31d76..a0a7e27 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -45,6 +45,7 @@ teardown() { health_checks } + @test "install from release" { set -eu -o pipefail cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) @@ -54,3 +55,14 @@ teardown() { health_checks } +@test "install from directory with nonstandard port" { + set -eu -o pipefail + cd ${TESTDIR} + ddev config --router-http-port=8080 --router-https-port=8443 + echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 + ddev get ${DIR} >/dev/null 2>&1 + ddev mutagen sync >/dev/null 2>&1 + health_checks +} + +