padraic/mockery — Issue #50: preg_match warning thrown if xdebug.scream=1
Author: robertbasic
Created: 2012-01-28 11:30:02+00:00
State: open

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 https://github.com/robertbasic/mockery/commit/d9d8dfa06b083de3a09016017e5cfa59ced3b408

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.