Comments (16)
I think it would solve some problems and we definitely should add something like that. But I think it could be done using pattern expanders, more like
[
@[email protected]({
"id": @integer@,
"name": "@[email protected](\"Posiłek \")",
"date": @string@
}).repeatTimes(10)
]
from php-matcher.
If I'll have time I'll try to implement it, but from I saw in the code I would need some help with this. Any docs on writing new features for the lib would generally be very useful.
from php-matcher.
If u are interested u could start with #34 its much simpler and you can contact me for any help.
from php-matcher.
from php-matcher.
I could try and implement multiple elements matching, if the example above is how would you see it. Looks fine for me.
from php-matcher.
I think you could start with repeatTimes($number)
expander. It should be generic. About this @json_object@ I'm not sure yet. Need to think about this but if you have any other propositions feel free to share them.
ping @defrag
from php-matcher.
[
@[email protected]({
"id": @integer@,
"name": "@[email protected](\"Posiłek \")",
"date": @string@
}).repeatTimes(10)
]
Would something like that work? I mean does expanders support nested patterns out of the box (@string@ inside contains etc.)? And should .repeatTimes() work only with strings? As integers and doubles probably could not make any sensible use of repeatTimes, I guess. Is there a way to limit where expanders could be attached? What you think?
from php-matcher.
@[email protected]({}) doesnt make too much sense, since you implicitly assume that the string is json string. Idea is pretty good tho, but perhaps something more like:
@[email protected]({
"id" : @integer@
}).repeatTimes(10)
from php-matcher.
hmm this match
expander sounds interesting.
from php-matcher.
@defrag looks really neat
from php-matcher.
+1
It would be really useful!!
What is the state of this feature? It's being developed?
from php-matcher.
+1
from php-matcher.
+1
from php-matcher.
+1
from php-matcher.
+1
from php-matcher.
@gitis @Sorpion @ZilKil @tompoc I think we all agree that this feature would be extremely useful, any of you is more than welcome to create a pull request. Unfortunately I simply don't have time to do it on my own, but don't hesitate to ask for any help you need.
from php-matcher.
Related Issues (20)
- Fix typo in project description HOT 1
- Cannot use `match` as an identifier. It is a reserved keyword since PHP8.0 HOT 2
- Add @[email protected]() or @[email protected]('....') expanders HOT 1
- Confusing error message HOT 3
- How does the `.inArray()` pattern expander work ? HOT 3
- Expecting null but give an array throws strange runtime error HOT 3
- Make possible to use assertMatchesPattern in static methods HOT 2
- generate php-matcher checking rules from Open API swagger annotation
- ValueError: array_fill(): Argument #2 ($count) must be greater than or equal to 0
- Use of mutation testing in php-matcher - Help needed
- Type pattern "@...@" is not supported by TextMatcher. HOT 4
- Cannot use positional argument after named argument HOT 1
- PHPUnit 10 support
- Consider upgrade doctrine/lexer to 2.x branch HOT 3
- Json array of object compare
- When new release with PHP Unit support? HOT 1
- Release 6.0.12 not longer compatible with PHPUnit 9 HOT 1
- Type pattern "@boolean@" is not supported? HOT 1
- Do not hide parsing error exceptions deeply in the code
- The match of type @integer@ doesn't work. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-matcher.