Skip to content

Commit

Permalink
[#300] Updated TaxonomyTrait.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Nov 3, 2024
1 parent 09b8441 commit df5b7b7
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 92 deletions.
7 changes: 7 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ A migration map of the step definitions available in v2 to v3.
| `When I index :type :title for search` | `When I add the :content_type content with the title :title to the search index` |
| `When I index :limit Search API items` | `When I run search indexing for :count item(s)` |
|   | |
| **[`TaxonomyTrait`](src/TaxonomyTrait.php) ([example](tests/behat/features/taxonomy.feature))** | |
| `Given no :vocabulary terms:` | `Given the following :vocabulary_machine_name vocabulary terms do not exist:` |
| `Given vocabulary :vid with name :name exists` | `Then the vocabulary :machine_name with the name :name should exists` |
| `Given taxonomy term :name from vocabulary :vocabulary_id exists` | `Then the taxonomy term :term_name from the vocabulary :vocabulary_machine_name should exist` |
| `When I visit :vocabulary vocabulary term :name` | `When I visit the :vocabulary_machine_name vocabulary :term_name term page` |
| `When I edit :vocabulary vocabulary term :name` | `When I edit the :vocabulary_machine_name vocabulary :term_name term page` |
|   | |
| **[`WaitTrait`](src/WaitTrait.php) ([example](tests/behat/features/wait.feature))** | |
| `Then /^(?:\|I )wait (\d+) second(s?)$/` | `When I wait for :number second(s)` |
| `Given I wait :timeout seconds for AJAX to finish` | `When I wait for :number second(s) for AJAX to finish` |
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ For migration from v2 to v3, see [MIGRATION.md](MIGRATION.md).
| `When I run search indexing for :count item(s)` | Index a specified number of items across all active Search API indices. |
|   | |
| **[`TaxonomyTrait`](src/TaxonomyTrait.php) ([example](tests/behat/features/taxonomy.feature))** | |
| `Given vocabulary :vid with name :name exists` | Assert that the specified vocabulary exists. |
| `Given taxonomy term :name from vocabulary :vocabulary_id exists` | Assert that the specified taxonomy term exists by name. |
| `Given no :vocabulary terms:` | Remove terms from the specified vocabulary. |
| `When I visit :vocabulary vocabulary term :name` | Visit the specified vocabulary term page. |
| `When I edit :vocabulary vocabulary term :name` | Visit the specified vocabulary term edit page. |
| `Given the following :vocabulary_machine_name vocabulary terms do not exist:` | Remove terms from the specified vocabulary. |
| `Then the vocabulary :machine_name with the name :name should exists` | Assert that the specified vocabulary exists. |
| `Then the vocabulary :machine_name should not exist` | Assert that the specified vocabulary does not exist. |
| `Then the taxonomy term :term_name from the vocabulary :vocabulary_machine_name should exist` | Assert that the specified taxonomy term exists by name. |
| `Then the taxonomy term :term_name from the vocabulary :vocabulary_machine_name should not exists` | Assert that the specified taxonomy term exists by name. |
| `When I visit the :vocabulary_machine_name vocabulary :term_name term page` | Visit the specified vocabulary term page. |
| `When I edit the :vocabulary_machine_name vocabulary :term_name term page` | Visit the specified vocabulary term edit page. |
|   | |
| **[`UserTrait`](src/UserTrait.php) ([example](tests/behat/features/user.feature))** | |
| `When I visit user :name profile` | Visit the profile page of the specified user. |
Expand Down
10 changes: 0 additions & 10 deletions src/OverrideTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
*/
trait OverrideTrait {

/**
* {@inheritdoc}
*/
public function createTerms(mixed $vocabulary, TableNode $table): void {
$vocabulary = (string) $vocabulary;
// Delete entities before creating them.
$this->taxonomyDeleteTerms($vocabulary, $table);
parent::createTerms($vocabulary, $table);
}

/**
* {@inheritdoc}
*/
Expand Down
Loading

0 comments on commit df5b7b7

Please sign in to comment.