/**
* Asserts that a haystack that is stored in a static attribute of a class
* or an attribute of an object contains a needle.
*
* @param mixed $needle
* @param string $haystackAttributeName
* @param mixed $haystackClassOrObject
* @param string $message
* @param bool $ignoreCase
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*/
function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = "", $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
{
return call_user_func_array(
"PHPUnit_Framework_Assert::assertAttributeContains",
func_get_args()
);
}
this code uses callbacks, but it"s not clear that it can"t be written properly. As follows:
function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = "", $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
{
return PHPUnit_Framework_Assert::assertAttributeContains(func_get_args());
}
Why not use this direct call instead of a callback? It feels a little pretentious.
Please give me some advice, thank you!