Skip to content

Example attribute usage #6646

@Sscorpion9991

Description

@Sscorpion9991

I am trying to use the new #[Examples()] attribute instead of annotation.
However, it requires me to update the tests.
For example in order to get the isLocked value from the Example attribute #[Examples(['isLocked' => true])] I need to get the first element of the array and only then get the isLocked value $isLocked = $examples[0]['isLocked'];.
I was previously able to get values from the annotation /** @example {"isLocked": true} */ just by $isLocked = $example['isLocked'];.

Could you please consider changing the Example attribute so it will be possible to update the annotation to attributes without changing the tests? I believe it would make it easier to use attributes and make the workflow more efficient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions