xp-framework/xp-framework — pull request #268 by iigorr (2013-03-28 16:30:33+00:00)
Title: Pattern Argument Matcher for Mocking Framework

Hi,

I have implemented a simple ArgumentMatcher wich can be applied to string arguments.

e.g.
```php
$mock->postComment(new PatternMatcher("/^hello SVN/"))->returns(false);
$mock->postComment(new PatternMatcher("/^hello git/"))->returns(true);
$this->mocks->replayAll();

$this->assertTrue($mock->postComment("hello git and SVN");
```

I have used preg_match for the implementation.

With this pullrequest the following bug is fixed. When a method uses dynamic parameter lists, e.g. uses func_get_args to access parameters, then matchers wouldn't work on those parameters.