Assertion:
$chain->expects($this->once())
->method('addMethodCall')
->with(
'addOptionsProvider',
array(
$this->isInstanceOf('Symfony\Component\DependencyInjection\Reference'),
$this->equalTo(7)
)
);
$chain is actually a mock object of Definition, and this is the code I'd like to test:
$definition->addMethodCall(
'addOptionsProvider',
array(new Reference($id), $priority)
);
I'm beginning PHPUnit, so I really don't know what I'm missing. I'm finding asserting about arguments really hard to understand. I've included an image with the visual difference between the assertion and the actual parameters.
PHPUnit_Framework_ExpectationFailedException : Expectation failed for method name is equal to when invoked 1 time(s) Parameter 1 for invocation Symfony\Component\DependencyInjection\Definition::addMethodCall('addOptionsProvider', Array (...)) does not match expected value.

EDIT: actually, I ended up with this:
$chain->expects($this->once())
->method('addMethodCall')
->with(
$this->identicalTo('addOptionsProvider'),
$this->logicalAnd(
$this->isType('array'),
$this->arrayHasKey(0),
$this->arrayHasKey(1)
)
);
But I can't "go" into the array values for making further assertion!