From fd875ab32a8b2294665b4d0f4aec85a696eb7c39 Mon Sep 17 00:00:00 2001 From: Albert Volkman Date: Thu, 28 Mar 2024 14:15:15 -0400 Subject: [PATCH] Reverse term removal --- src/Drupal/DrupalExtension/Context/RawDrupalContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php index 81e5d2e0..e31751da 100644 --- a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php @@ -282,7 +282,7 @@ public function cleanUsers() public function cleanTerms() { // Remove any terms that were created. - foreach ($this->terms as $term) { + foreach (array_reverse($this->terms) as $term) { $this->getDriver()->termDelete($term); } $this->terms = [];