This step checks if the database contains an entity of a specific type with the given properties.
Then I see entity "App\Entity\User" with properties:
"""
{
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"active": true
}
"""This step allows you to verify that a specific entity exists in the database by matching multiple property values. It performs a count query with conditions on each specified property and expects exactly one matching entity.
entityClass: The fully-qualified class name of the entity to checkproperties: A JSON string containing key-value pairs representing entity properties to match
- Verifying that an entity with specific field values exists
- Checking that entity properties match expected values after operations
- Validating complex entity state with multiple property conditions
- Testing business logic that modifies entity properties
Both steps support Doctrine embedded objects using dotted property paths:
Then I see entity "App\Entity\Balance" with properties:
"""
{
"customerId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
"balanceValue.amount": "500000",
"balanceValue.currency": "USD",
}
"""The dotted notation (e.g., balanceValue.amount) allows querying embedded value objects defined in your entity mappings.
- Properties with
nullvalues are queried usingIS NULLcondition - All other properties are matched using equality
- Embedded property paths use dotted notation (e.g.,
embeddable.field)