php-matcher
php-matcher copied to clipboard
The easiest way to match data structures like JSON/PlainText/XML against readable patterns. Sandbox:
Usecase: I build REST-API and generate documentation with an OA3 swagger file (JSON or yaml). In this file I describe data structures with type hints https://petstore.swagger.io/v2/swagger.json (example). I need to...
Sometimes I get into cases where I want to use the `assertMatchesPattern` like other assertions in a static method. Maybe the `assertMatchesPattern` could be changed from: ```php protected function assertMatchesPattern($pattern,...
**Problem:** If you get a very long text in the compared string, it makes it very difficult to debug the console. For example using `PHPMatcherConstraint` with API tests, when response...
In project I'm currently working on, we had a following scenario step: ``` And json response should match: """ { "limit": 10, "offset": 0, "count": 1, "wins": @[email protected](1) } """...
Hi, Thanks for your work on this package, it's really nice! In my test cases I am in need to use matchers for keys too, I saw this is currently...
Hello, I'm not sure it's realistic but well, I think it's something missing with this lib so here is the issue. If I have serveral minutes, gonna try to make...
```console ValueError: array_fill(): Argument #2 ($count) must be greater than or equal to 0 │ ╵ /Users/Aerendir/Documents/path/to/app/vendor/coduo/php-matcher/src/Matcher/ArrayMatcher.php:123 ╵ /Users/Aerendir/Documents/path/to/app/vendor/coduo/php-matcher/src/Matcher/ArrayMatcher.php:176 ╵ /Users/Aerendir/Documents/path/to/app/vendor/coduo/php-matcher/src/Matcher/ArrayMatcher.php:176 ╵ /Users/Aerendir/Documents/path/to/app/vendor/coduo/php-matcher/src/Matcher/ArrayMatcher.php:176 ╵ /Users/Aerendir/Documents/path/to/app/vendor/coduo/php-matcher/src/Matcher/ArrayMatcher.php:75 ╵ /Users/Aerendir/Documents/path/to/app/vendor/coduo/php-matcher/src/Matcher/ChainMatcher.php:45 ╵ /Users/Aerendir/Documents/path/to/app/vendor/coduo/php-matcher/src/Matcher.php:25 ╵...
Hello, I have some deprecation notice using `Coduo\PHPMatcher\PHPUnit\PHPMatcherAssertions::matchesPattern` function because `Coduo\PHPMatcher\Parser` is using deprecated array access on a `Coduo\PHPMatcher\Lexer` object. I have exactly this error: ``` Indirect deprecation triggered by...
For now, it is not supported. It prevents doctrine/orm package from being upgraded because it [requires](https://github.com/doctrine/orm/blob/95da667862eeb1f94f3b09b2ebc708cfd929f5fe/composer.json#L32C10-L32C32) doctrine/lexer 3 and higher.
There is already a closed issue that reports my same exact problem: - https://github.com/coduo/php-matcher/issues/212 My array structure is almost this: ```json { "@context": "\/api\/contexts\/MyClass", "@id": "\/api\/myclasses\/2", "hydra:member": [ { "id":...