public function testAdapterMethods($methodName, $expectedException, $returnValue, array $args)
{
/* @var BetterReflectionObject|\PHPUnit_Framework_MockObject_MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionObject::class);
if (null === $expectedException) {
$reflectionStub->expects($this->once())->method($methodName)->with(...$args)->will($this->returnValue($returnValue));
}
if (null !== $expectedException) {
$this->expectException($expectedException);
}
$adapter = new ReflectionObjectAdapter($reflectionStub);
$adapter->{$methodName}(...$args);
}