Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/palantirnet/drupal-rector
A developer utility for automatically upgrading deprecated code for Drupal 9
https://github.com/palantirnet/drupal-rector
drupal hacktoberfest php rector
Last synced: about 10 hours ago
JSON representation
A developer utility for automatically upgrading deprecated code for Drupal 9
- Host: GitHub
- URL: https://github.com/palantirnet/drupal-rector
- Owner: palantirnet
- Created: 2020-01-16T01:08:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T15:12:38.000Z (about 2 months ago)
- Last Synced: 2024-12-05T22:05:31.250Z (7 days ago)
- Topics: drupal, hacktoberfest, php, rector
- Language: PHP
- Homepage:
- Size: 1.59 MB
- Stars: 144
- Watchers: 22
- Forks: 74
- Open Issues: 8
-
Metadata Files:
- Readme: README-automated-testing.md
Awesome Lists containing this project
- stars - palantirnet/drupal-rector - A developer utility for automatically upgrading deprecated code for Drupal 9 (PHP)
README
# Automated testing
## Unit testing
The Drupal Rector project has PHPUnit tests, extending the testing suite functionality provided by Rector. This allows
the project to have confidence in the written Rector rules. To run the unit tests, there are different system requirements
than if you ran Drupal Rector against your Drupal site.To run the PHPUnit tests:
* Clone your fork of the repository
* Run `composer install`
* Run `php vendor/bin/phpunit`See the `.github/workflows/phpunit.yml` workflow for an example.
### Writing a PHPUnit test
For now, please see the example in `tests/src/Rector/Deprecation/DatetimeStorageTimezoneRector`.
## Installation test
GitHub Action workflows test that this package can be installed. See the workflows in `.github/workflows`.
## Rector functional testing
The functional test takes the `rector_examples` directory in this package and copies it to a Drupal code base.
The workflow then runs `vendor/bin/rector process web/modules/custom/rector_examples` to apply all of the appropriate Rector rules.
Then, the `diff` command is run to verify the changes match the expected results as found in the `rector_examples_updated` directory.
To add new tests, create a sample file in `rector_examples` and a copy with the expected changes into `rector_examples_updated`.