Skip to content

TestTraits should have clearer failure messages #52

@Firehed

Description

@Firehed

In particular, the assertions made with testGetUri fail in a very unclear way. Something like this will roughly fix it:

         $this->assertSame($match, (bool) preg_match($pattern, $uri, $matches), "$uri did (not) match endpoint's pattern");
         foreach ($expectedMatches as $key => $value) {
             $this->assertTrue(array_key_exists($key, $matches), "$key not found in matches");
             $this->assertSame($value, $matches[$key], "match for $key was incorrect");
         }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions