- heddn Nicaragua
Can we add a simple test to confirm this is working as expected?
- Status changed to Needs review
over 1 year ago 11:23am 3 July 2023 - last update
over 1 year ago run-tests.sh fatal error - 🇮🇳India sumit-k
Hi, I have reviewed the provided patch and added a test for the "drush sanitize" command. Please find the updated patch attached for review.
- last update
over 1 year ago run-tests.sh fatal error - Status changed to Needs work
over 1 year ago 8:46pm 4 July 2023 - heddn Nicaragua
+++ b/composer.json @@ -20,5 +20,12 @@ + "extra": {
Can we add a require-dev section for drush/drush?
- last update
over 1 year ago 5 pass - heddn Nicaragua
This is looking really nice. Just a few small nits.
-
+++ b/composer.json @@ -18,7 +18,23 @@ + "drush.services.yml": "^9"
should this include an OR and include drush 10, 11 and 12 as well? Or is the version not needed at all? Actually, test things but I don't think the entry is needed at all. See my later point about changing class namespace.
-
+++ b/src/Commands/RealnameSanitizeCommand.php @@ -0,0 +1,88 @@ + * @hook post-command sql-sanitize +++ b/tests/src/Functional/RealnameBasicTest.php @@ -183,4 +184,14 @@ class RealnameBasicTest extends BrowserTestBase { + $this->drush('sql-sanitize', [], ['sanitize-realname' => 1]);
Can we add an assert about the messages to include, "Truncate realname table."?
$this->assertStringContainsString('Truncate realname table.', $this->getOutput());
-
+++ b/composer.json @@ -18,7 +18,23 @@ + "drush.services.yml": "^9" +++ b/drush.services.yml @@ -0,0 +1,6 @@ + class: \Drupal\realname\Commands\RealnameSanitizeCommand +++ b/src/Commands/RealnameSanitizeCommand.php @@ -0,0 +1,88 @@ +namespace Drupal\realname\Commands;
If the namespace changes to
Drupal\realname\Drush
and implements a staticcreate()
method, then I don't think any of this is needed. It will get auto bootstrapped and discovered.public static function create(ContainerInterface $container): self { return new static( $container->get('database') ); }
-
- 🇮🇳India sumit-k
Thanks for the review. Sharing new patch covered point 2.
Regarding points 1 and 3.+++ b/composer.json @@ -18,7 +18,23 @@ + "drush.services.yml": "^9"
It seems it will be required for Drush 10.
Based on the provided documentation https://git.uwaterloo.ca/libraries/drush/-/blob/11.x/docs/commands.md, it appears that including the drush.services.yml file and the /src/Drupal/Commands directory is indeed required
Not sure about dependency injection based on the following document it has two way to use dependency injection
https://git.uwaterloo.ca/libraries/drush/-/blob/11.x/docs/dependency-inj...Please correct me if my understanding is not clear.
- heddn Nicaragua
https://git.drupalcode.org/project/migrate_tools/-/blob/6.0.x/src/Drush/... has passing green tests w/ drush 11 and drush 12. I had to limit support to at least drush 11 as I couldn't get drush 10 and 12 to both support things at the same time. But since drush 10 no longer is supported, I think that is OK.
- 🇳🇱Netherlands ecvandenberg
After updating this module to 2.0.0 the #8 patch does not apply anymore. A fix is very welcome...