Skip to content

Confusing error message  #227

Closed
Closed
@alexsegura

Description

@alexsegura

Hi.

Thank you for making PHP Matcher 🙂

With a PHP Matcher expectation like this:

{
  "@context":"/api/contexts/ConstraintViolationList",
  "@type":"ConstraintViolationList",
  "hydra:title":"An error occurred",
  "hydra:description":@string@,
  "violations":[
    {
      "propertyPath":"total",
      "message":@string@,
      "code":""
    }
  ]
}

If [violations][0][code] is null null, PHP Matcher gives the following message

Value "" does not match pattern "" at path: "[violations][0][code]"

This is confusing, when seeing this you wonder why "" !== "" 🤔


Maybe it could be instead:

Value null does not match pattern "" at path: "[violations][0][code]"

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