Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add phpunit to local development #949

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .docker/Dockerfile.govcms
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN echo "memory_limit = 512M" >> /usr/local/etc/php/conf.d/docker-php-ram-limit
# Set Composer environment variables
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_MEMORY_LIMIT=-1
ENV SIMPLETEST_BASE_URL="http://localhost"
ENV SIMPLETEST_BASE_URL="http://govcms"
ENV SIMPLETEST_DB='mysql://drupal:drupal@mariadb/drupal'

# Set working directory
Expand All @@ -34,8 +34,7 @@ COPY composer.json ./
# Install Composer dependencies
RUN \
--mount=type=cache,mode=0777,target=/root/.composer/cache \
composer config --no-plugins allow-plugins.phpstan/extension-installer 1 && \
composer require palantirnet/drupal-rector drupal/core-dev:"^10.0" mglaman/drupal-check --dev --no-update && \
composer require palantirnet/drupal-rector mglaman/drupal-check --dev --no-update && \
composer update --no-scripts --no-autoloader && \
cp vendor/palantirnet/drupal-rector/rector.php .

Expand All @@ -55,11 +54,10 @@ COPY . /app/
# Configure Composer
RUN \
--mount=type=cache,mode=0777,target=/root/.composer/cache \
composer config --no-plugins allow-plugins.phpstan/extension-installer 1 && \
composer install

# Adjust ownership
RUN chown -R www-data:www-data web/sites web/modules web/themes

# Set the PATH environment variable
ENV PATH=${PATH}:/app/bin
ENV PATH=${PATH}:/app/bin
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"webflo/drupal-finder": "^1.2"
},
"require-dev": {
"drupal/core-dev": "^10.1",
"drush/drush": "~12"
},
"config": {
Expand All @@ -135,7 +136,8 @@
"drupal/core-composer-scaffold": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"oomphinc/composer-installers-extender": true,
"drupal/core-vendor-hardening": true
"drupal/core-vendor-hardening": true,
"phpstan/extension-installer": true
},
"bin-dir": "bin/",
"sort-packages": true,
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
volumes:
- /root/.composer
- /var/www/html/sites
- $PWD/config:/app/web/profiles/govcms/config
- $PWD/modules:/app/web/profiles/govcms/modules
- $PWD/themes:/app/web/profiles/govcms/themes
- $PWD/src:/app/web/profiles/govcms/src
Expand All @@ -21,6 +22,7 @@ services:
path: .
target: /app/web/profiles/govcms
ignore:
- config/
- modules/
- themes/
- src/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testUserAdd() {
'administer users',
]);
$this->drupalLogin($user);

// Test user creation page for valid password length.
$name = $this->randomMachineName();
$edit = [
Expand Down