PHPUnit_Framework_Assert::attribute PHP Method

attribute() public static method

Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
public static attribute ( PHPUnit_Framework_Constraint $constraint, string $attributeName ) : PHPUnit_Framework_Constraint_Attribute
$constraint PHPUnit_Framework_Constraint
$attributeName string
return PHPUnit_Framework_Constraint_Attribute
    public static function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
    {
        return new PHPUnit_Framework_Constraint_Attribute($constraint, $attributeName);
    }

Usage Example

 /**
  * @param string $attributeName
  * @param mixed  $value
  * @param float  $delta
  * @param int    $maxDepth
  * @param bool   $canonicalize
  * @param bool   $ignoreCase
  *
  * @return \PHPUnit_Framework_Constraint_Attribute
  */
 public static function attributeEqualTo($attributeName, $value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
 {
     return \PHPUnit_Framework_Assert::attribute(self::equalTo($value, $delta, $maxDepth, $canonicalize, $ignoreCase), $attributeName);
 }
All Usage Examples Of PHPUnit_Framework_Assert::attribute
PHPUnit_Framework_Assert