Skip to content

Commit 6ef9686

Browse files
authored
PHPUnit 10 support (#34)
* 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
1 parent a3668d2 commit 6ef9686

File tree

5 files changed

+16
-67
lines changed

5 files changed

+16
-67
lines changed

.env.dist

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ BASE_URI=http://127.0.0.1:8080
77
UID=1000
88
GID=1000
99

10+
# PHPUnit
11+
SIMPLETEST_BASE_URL=http://127.0.0.1:8080
12+
SIMPLETEST_DB=mysql://local:[email protected]/local
13+
BROWSERTEST_OUTPUT_DIRECTORY=/tmp
14+
BROWSERTEST_OUTPUT_BASE_URL=${BASE_URI}
15+
BROWSERTEST_OUTPUT_VERBOSE=true
16+
1017
# CHROME DRIVER
11-
# SELENIUM_IMAGE=drupalci/chromedriver:production
12-
# 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"]'
18+
SELENIUM_IMAGE=drupalci/chromedriver:production
19+
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"]'
1320

1421
## SELENIUM CHROME
1522
# SELENIUM_IMAGE=selenium/standalone-chrome:111.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Alternatively you can run phpunit on the command line like so:
7272

7373
```
7474
docker-compose exec php-cli bash
75-
phpunit app/core/tests/Drupal/Tests/Core/DrupalKernel/
75+
phpunit -c app/core/phpunit.xml.dist app/core/tests/Drupal/Tests/Core/DrupalKernel/
7676
```
7777

7878
## Debugging

assets/scaffold/files/php.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</component>
1616
<component name="PhpUnit">
1717
<phpunit_settings>
18-
<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" />
18+
<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" />
1919
</phpunit_settings>
2020
</component>
2121
</project>

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ services:
4141
network_mode: service:nginx
4242
environment:
4343
- DRUSH_OPTIONS_URI=${BASE_URI:-http://127.0.0.1:8080}
44+
- PHP_IDE_CONFIG=serverName=localhost
45+
- SIMPLETEST_BASE_URL=${SIMPLETEST_BASE_URL:-http://127.0.0.1:8080}
46+
- SIMPLETEST_DB=${SIMPLETEST_DB:-mysql://local:[email protected]/local}
47+
- BROWSERTEST_OUTPUT_DIRECTORY=${BROWSERTEST_OUTPUT_DIRECTORY:-/tmp}
4448
- BROWSERTEST_OUTPUT_BASE_URL=${BASE_URI:-http://127.0.0.1:8080}
49+
- BROWSERTEST_OUTPUT_VERBOSE=${BROWSERTEST_OUTPUT_VERBOSE:-true}
4550
- MINK_DRIVER_ARGS_WEBDRIVER
46-
- PHP_IDE_CONFIG=serverName=localhost
4751
volumes:
4852
- ./:/data
4953
- ./.docker/php/custom.ini:/etc/php/conf.d/99-custom.ini

phpunit.xml

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)