Skip to content

Commit

Permalink
PHPUnit 10 support (#34)
Browse files Browse the repository at this point in the history
* Set PHPUnit env vars in docker instead of phpunit.xml

* Remove phpunit.xml and update phpstorm config to use phpunit.xml.dist from core

* Update README to include core phpunit config

* BROWSERTEST_OUTPUT_VERBOSE=true

* Add env vars to dist
  • Loading branch information
mstrelan authored May 7, 2024
1 parent a3668d2 commit 6ef9686
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 67 deletions.
11 changes: 9 additions & 2 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ BASE_URI=http://127.0.0.1:8080
UID=1000
GID=1000

# PHPUnit
SIMPLETEST_BASE_URL=http://127.0.0.1:8080
SIMPLETEST_DB=mysql://local:[email protected]/local
BROWSERTEST_OUTPUT_DIRECTORY=/tmp
BROWSERTEST_OUTPUT_BASE_URL=${BASE_URI}
BROWSERTEST_OUTPUT_VERBOSE=true

# CHROME DRIVER
# SELENIUM_IMAGE=drupalci/chromedriver:production
# MINK_DRIVER_ARGS_WEBDRIVER='["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--headless", "--disable-gpu", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://127.0.0.1:9515"]'
SELENIUM_IMAGE=drupalci/chromedriver:production
MINK_DRIVER_ARGS_WEBDRIVER='["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--headless", "--disable-gpu", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://127.0.0.1:9515"]'

## SELENIUM CHROME
# SELENIUM_IMAGE=selenium/standalone-chrome:111.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Alternatively you can run phpunit on the command line like so:

```
docker-compose exec php-cli bash
phpunit app/core/tests/Drupal/Tests/Core/DrupalKernel/
phpunit -c app/core/phpunit.xml.dist app/core/tests/Drupal/Tests/Core/DrupalKernel/
```

## Debugging
Expand Down
2 changes: 1 addition & 1 deletion assets/scaffold/files/php.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</component>
<component name="PhpUnit">
<phpunit_settings>
<phpunit_by_interpreter interpreter_id="f58849c8-e0cd-4acc-973b-98da73eaafb1" configuration_file_path="/data/phpunit.xml" custom_loader_path="/data/vendor/autoload.php" phpunit_phar_path="" use_configuration_file="true" />
<phpunit_by_interpreter interpreter_id="f58849c8-e0cd-4acc-973b-98da73eaafb1" configuration_file_path="/data/app/core/phpunit.xml.dist" custom_loader_path="/data/vendor/autoload.php" phpunit_phar_path="" use_configuration_file="true" />
</phpunit_settings>
</component>
</project>
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ services:
network_mode: service:nginx
environment:
- DRUSH_OPTIONS_URI=${BASE_URI:-http://127.0.0.1:8080}
- PHP_IDE_CONFIG=serverName=localhost
- SIMPLETEST_BASE_URL=${SIMPLETEST_BASE_URL:-http://127.0.0.1:8080}
- SIMPLETEST_DB=${SIMPLETEST_DB:-mysql://local:[email protected]/local}
- BROWSERTEST_OUTPUT_DIRECTORY=${BROWSERTEST_OUTPUT_DIRECTORY:-/tmp}
- BROWSERTEST_OUTPUT_BASE_URL=${BASE_URI:-http://127.0.0.1:8080}
- BROWSERTEST_OUTPUT_VERBOSE=${BROWSERTEST_OUTPUT_VERBOSE:-true}
- MINK_DRIVER_ARGS_WEBDRIVER
- PHP_IDE_CONFIG=serverName=localhost
volumes:
- ./:/data
- ./.docker/php/custom.ini:/etc/php/conf.d/99-custom.ini
Expand Down
62 changes: 0 additions & 62 deletions phpunit.xml

This file was deleted.

0 comments on commit 6ef9686

Please sign in to comment.