drupalextension icon indicating copy to clipboard operation
drupalextension copied to clipboard

Allow creation of entities of any type with base field value parsing

Open chrisolof opened this issue 1 year ago • 1 comments

Resolves #194.

This was built and tested in a D10 environment. Pairs really well with jhedstrom/DrupalDriver/pull/271.

Opens up stuff like this:

Given "commerce_product_variation" entities:
  | title | type     | field_manufacturer | sku      | field_category | price:number | price:currency_code | status |
  | TNT   | product  | ACME               | TNT-01   | Excavation     | 200          | USD                 | 1      |
  | Anvil | product  | ACME               | ANVIL-01 | Metal          | 450          | USD                 | 1      |
  And "commerce_product" entities:
    | title | type     | variations | stores         | status |
    | TNT   | product  | TNT        | ACME Web Store | 1      |
    | Anvil | product  | Anvil      | ACME Web Store | 1      |

Deletes the entities out after scenario in reverse order so as to respect dependent entity setups.

Otherwise pretty much follows the node/term/user creation and cleanup patterns. But now we can set up entities of any type.

chrisolof avatar Mar 06 '24 00:03 chrisolof

Thank you ! I spent few hours trying to make the price field works and could not understand why it worked for other compound fields (like address field). The base fields were indeed ignored from the parsing method

DamienGR avatar Feb 26 '25 23:02 DamienGR