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

Adding tests for Rector with Drupal #2891

Closed
wants to merge 18 commits into from
43 changes: 43 additions & 0 deletions .github/workflows/test_with_drupal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test With Drupal

on:
pull_request: null
push:
branches:
- master

jobs:
test_with_drupal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
extensions: "intl"

# Run standalone install in non-root package, ref https://github.com/rectorphp/rector/issues/732
- run: |
# 1. install locally
mkdir test-paths
cd test-paths

# Install latest Rector
mkdir rector-dir
# composer require rector/rector:@dev -d rector-dir --no-progress
# composer require rector/rector:0.6.13 -d rector-dir --no-progress
composer require palantirnet/drupal-rector:dev-rector-0.7 -d rector-dir --no-progress

# Install Drupal
mkdir drupal-dir
composer create-project drupal/recommended-project drupal-dir --dev --no-progress

# missing for some reason
# composer require doctrine/doctrine-fixtures-bundle -d symfony-demo-dir --no-progress
# composer dump-autoload --no-dev -d symfony-demo-dir

# 2. run rector

cd drupal-dir
../rector-dir/vendor/bin/rector process web/core/modules/aggregator/src/Plugin/views/row/Rss.php --dry-run --config ../../ci/config/rector-drupal.yaml
14 changes: 14 additions & 0 deletions ci/config/rector-drupal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
parameters:
autoload_paths:
- 'web/core'
- 'web/core/modules'
- 'web/modules'
- 'web/profiles'

file_extensions:
- module
- theme
- install
- profile
- inc
- engine