Skip to content

Given (a/an) :entity entity/entities/item/items #194

@jonathanjfshaw

Description

@jonathanjfshaw

Following on from: https://www.drupal.org/node/2537618, planning for adding support beyond nodes to the more basic content entities.

JHedstrom commented there:
"In the Drupal Drivers, there would be new methods added. For the changes to the Drupal Extension, these could go into a dedicated EntityContext class so people could enable that as needed."

Questions:

  1. Is "Given (a/an) :entity entity/entities/item/items" the only relevant step definition for basic entities?
  2. Is the turnip syntax I'm suggesting - requiring the keyword "entity" or "item" - the right one?
  3. Am I correct that implementation would require
  • a nakedEntityCreate and createNakedEntity corresponding to every nodeCreate and createNode that there is in the Drupal Driver (D7 & D8) and Drupal Extension;
  • likewise for other "node" syntax like nodeDelete, beforeNodeCreate, etc.
  • a step definition using the syntax above
  • a feature to test this module is working right

Lastly, teardown is a significant challenge. AFAIK this project removes test data by removing all data created by the user created in the test process. However, basic entities do not necessarily record who created or owns them. My suggestion is that when working with basic entities we would have to record the full set of fields specified in the Given, and then delete entities that match those fields.

This could potentially delete too many entities in the case that the supplied fields overlapped with existing entities of the type, so we would need to document clearly the importance of giving novel values for the fields of the entities to be Given...
"Given a Pizza item with Flavor "test flavor gdfdfsh"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions