Skip to content

Commit 3d9e266

Browse files
author
Kalle Vuorjoki
committed
Update the project
1 parent 42c95f4 commit 3d9e266

File tree

11 files changed

+4729
-3221
lines changed

11 files changed

+4729
-3221
lines changed

.ddev/commands/web/phpunit

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
## Description: Runs phpunit tests
4+
## Usage: phpunit
5+
## Example: "ddev phpunit path/to/tests"
6+
## Example: "ddev phpunit --testsuite=unit"
7+
8+
# Disable Xdebug to speed up test executions and to avoid debugger connection
9+
# problems.
10+
disable_xdebug
11+
12+
# Start ChromeDriver process.
13+
#nohup chromedriver --log-path=/var/www/html/tmp/chromedriver.log --port=9515 &> /dev/null &
14+
15+
# Run tests.
16+
cd /var/www/html
17+
phpunit --process-isolation $@

.ddev/config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: ddev-phpunit-demo
2-
type: drupal9
2+
type: drupal10
33
docroot: web
4-
php_version: "8.0"
4+
php_version: "8.2"
55
webserver_type: nginx-fpm
66
router_http_port: "80"
77
router_https_port: "443"
88
xdebug_enabled: false
99
additional_hostnames: []
1010
additional_fqdns: []
11-
mariadb_version: "10.3"
11+
mariadb_version: "10.5"
1212
mysql_version: ""
1313
use_dns_when_possible: true
1414
composer_version: ""

.ddev/docker-compose.chrome.yml

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

.ddev/docker-compose.chromedriver.yml

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

.ddev/docker-compose.env.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ddev-generated
2+
# Remove the line above if you don't want this file to be overwritten when you run
3+
# ddev get ddev/ddev-selenium-standalone-chrome
4+
#
5+
# This file comes from https://github.com/ddev/ddev-selenium-standalone-chrome
6+
#
7+
version: '3.6'
8+
services:
9+
selenium-chrome:
10+
image: seleniarm/standalone-chromium:4.1.4-20220429
11+
container_name: ddev-${DDEV_SITENAME}-selenium-chrome
12+
expose:
13+
# The internal noVNC port, which operates over HTTP so it can be exposed
14+
# through the router.
15+
- 7900
16+
environment:
17+
- VIRTUAL_HOST=$DDEV_HOSTNAME
18+
- HTTPS_EXPOSE=7900:7900
19+
- HTTP_EXPOSE=7910:7900
20+
external_links:
21+
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}
22+
# To enable VNC access for traditional VNC clients like macOS "Screen Sharing",
23+
# uncomment the following two lines.
24+
#ports:
25+
# - "5900:5900"
26+
labels:
27+
com.ddev.site-name: ${DDEV_SITENAME}
28+
com.ddev.approot: $DDEV_APPROOT
29+
# UHC: Mount /dev/shm to host to avoid chrome chrashes.
30+
volumes:
31+
- ".:/mnt/ddev_config"
32+
- "/dev/shm:/dev/shm"
33+
34+
web:
35+
links:
36+
- selenium-chrome

.vscode/settings.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"breadcrumbs.enabled": true,
3+
"css.validate": true,
4+
"diffEditor.ignoreTrimWhitespace": false,
5+
"editor.tabSize": 2,
6+
"editor.autoIndent": "full",
7+
"editor.insertSpaces": true,
8+
"editor.formatOnPaste": false,
9+
"editor.formatOnSave": false,
10+
"editor.renderWhitespace": "boundary",
11+
"editor.wordWrapColumn": 80,
12+
"editor.wordWrap": "off",
13+
"editor.detectIndentation": true,
14+
"editor.rulers": [
15+
80
16+
],
17+
"files.associations": {
18+
"*.inc": "php",
19+
"*.module": "php",
20+
"*.install": "php",
21+
"*.theme": "php",
22+
"*.profile": "php",
23+
"*.tpl.php": "php",
24+
"*.test": "php",
25+
"*.php": "php",
26+
"*.info": "ini"
27+
},
28+
"files.trimTrailingWhitespace": true,
29+
"files.insertFinalNewline": true,
30+
"html.format.enable": true,
31+
"html.format.wrapLineLength": 80,
32+
"php.suggest.basic": false,
33+
"phpCodeSniffer.autoExecutable": true,
34+
"phpCodeSniffer.standard": "Custom",
35+
"phpCodeSniffer.standardCustom": "Drupal,DrupalPractice"
36+
}
37+

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# DDev PHPUnit Demo
22

3+
## What is inside of this fork
4+
5+
- Drupal 10.2 support
6+
- joachim-n/drupal-project-contrib-development for easier contrib development
7+
- Simpler setup
8+
- VSCode support
9+
10+
## How to use
11+
12+
- `ddev start`
13+
- Replace `MODULE_NAME` on following with name of your contrib module.
14+
- `ddev composer require drupal/MODULE_NAME`
15+
- `ddev composer drupal-contrib:switch-clone MODULE_NAME`
16+
- `ddev phpunit -v web/modules/contrib/MODULE_NAME`
17+
- `ddev phpunit --group MODULE_NAME`
18+
19+
## Original readmd
20+
321
See [Running and debugging PHPUnit tests in PHPStorm with DDev and xdebug](https://www.previousnext.com.au/blog/running-and-debugging-phpunit-tests-phpstorm-ddev-and-xdebug) for a video demo covering configuration for running and debugging:
422

523
* Unit tests

composer.json

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,45 @@
44
"type": "project",
55
"license": "GPL-2.0-or-later",
66
"homepage": "https://github.com/mstrelan/ddev-phpunit-demo",
7-
"repositories": [
8-
{
7+
"repositories": {
8+
"maxlength": {
9+
"type": "path",
10+
"url": "repos/maxlength",
11+
"options": {
12+
"versions": {
13+
"drupal/maxlength": "dev-3.x"
14+
}
15+
}
16+
},
17+
"0": {
918
"type": "composer",
1019
"url": "https://packages.drupal.org/8"
1120
}
12-
],
21+
},
1322
"require": {
1423
"composer/installers": "^1.9",
15-
"drupal/core-composer-scaffold": "^9.2",
16-
"drupal/core-recommended": "^9.2",
17-
"drush/drush": "^10.6"
24+
"drupal/core-composer-scaffold": "^10.2",
25+
"drupal/core-recommended": "^10.2",
26+
"drupal/maxlength": "^3.x-dev",
27+
"drush/drush": "^12.0",
28+
"joachim-n/drupal-project-contrib-development": "dev-main",
29+
"weitzman/drupal-test-traits": "^2"
1830
},
1931
"conflict": {
2032
"drupal/drupal": "*"
2133
},
22-
"minimum-stability": "stable",
34+
"minimum-stability": "dev",
2335
"prefer-stable": true,
2436
"config": {
25-
"sort-packages": true
37+
"sort-packages": true,
38+
"allow-plugins": {
39+
"composer/installers": true,
40+
"drupal/core-composer-scaffold": true,
41+
"php-http/discovery": true,
42+
"phpstan/extension-installer": true,
43+
"dealerdirect/phpcodesniffer-composer-installer": true,
44+
"joachim-n/drupal-project-contrib-development": true
45+
}
2646
},
2747
"extra": {
2848
"drupal-scaffold": {
@@ -63,8 +83,7 @@
6383
},
6484
"require-dev": {
6585
"dmore/chrome-mink-driver": "^2.8",
66-
"drupal/core-dev": "^9.2",
67-
"phpspec/prophecy-phpunit": "^2.0",
68-
"weitzman/drupal-test-traits": "^1.5"
86+
"drupal/core-dev": "^10.2",
87+
"phpspec/prophecy-phpunit": "^2.0"
6988
}
7089
}

0 commit comments

Comments
 (0)