You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, I know that I'm expecting "bar" and "baz" there, and providing "spam" and "ham" instead, but, the problem is that the preg_match warning masks the real error: "Mockery\Exception: No matching handler found for ...", which produces a lot of head-scratching to figure out what is going on.
The offending preg_match is in Mockery\Expectation::_matchArg, around line 278.
The text was updated successfully, but these errors were encountered:
Not to kick a two-year-old-dead horse, but! :) I just spent 8 hours of my life trying to figure out why my unit tests were kicking out a:
ErrorException: preg_match(): Delimiter must not be alphanumeric or backslash
The final solution was to turn off xdebug's scream option.
So... is there a better way to handle the preg_match()'s in the Expectation class without using the nasty @ error suppressor? Maybe just some simple strpos() checks for the required regex delimiters or something? Sorry, I'm not familiar with the code enough to know if this is just an impossibility.
Hello!
If one has xdebug.scream turned on, preg_match in some cases can throw a warning.
A test for this can be found at robertbasic@d9d8dfa
Now, I know that I'm expecting "bar" and "baz" there, and providing "spam" and "ham" instead, but, the problem is that the preg_match warning masks the real error: "Mockery\Exception: No matching handler found for ...", which produces a lot of head-scratching to figure out what is going on.
The offending preg_match is in Mockery\Expectation::_matchArg, around line 278.
The text was updated successfully, but these errors were encountered: