Skip to content

Commit

Permalink
Add phpunit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrelan authored Jan 9, 2024
1 parent 85bb69e commit 9cdb94d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/phpunit.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
DRUPAL_VERSION="${DRUPAL_VERSION:-9.4}"

setup() {
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
cd "$DIR/../" || exit
BREW_PREFIX="$(brew --prefix)"
load "${BREW_PREFIX}/lib/bats-assert/load.bash"
}

dce() {
docker compose exec -T php-cli "$@"
}

phpunit() {
dce phpunit "$@"
}

@test "Drupal unit test" {
run phpunit app/core/tests/Drupal/Tests/Core/DrupalTest.php
assert_output --partial "OK"
}

@test "Drupal kernel test" {
run phpunit app/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
assert_output --partial "OK"
}

@test "Drupal functional test" {
run phpunit app/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
assert_output --partial "OK"
}

@test "Drupal functional javascript test" {
run phpunit app/core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php
assert_output --partial "OK"
}

0 comments on commit 9cdb94d

Please sign in to comment.