## Apache Zeta Components Manual :: Docs For Class ezcTestConstraintSimilarImage

### UnitTest::ezcTestConstraintSimilarImage

### Class ezcTestConstraintSimilarImage

Constraint class for image comparison.

Source for this file: /UnitTest/src/constraint/image.php

    PHPUnit_Framework_Constraint
       |
       --ezcTestConstraintSimilarImage

Version: | //autogentag//

### Member Variables

protected int | `$delta` Maximum delta between images.
protected int | `$difference` Difference between images.
protected string | `$filename` Filename of the image to compare against.

### Method Summary

public ezcConstraintSimilarImage | `__construct( $filename , [ $delta = 0] )` Constructor.
public abstract bool | `evaluate( $other )` Evaluates the constraint for parameter $other. Returns TRUE if the constraint is met, FALSE otherwise.
public void | `fail( $other , $description , [ $not = false] )` Creates the appropriate exception for the constraint which can be caught by the unit test system. This can be called if a call to evaluate() fails.
public string | `toString( )` Provide test text

### Methods

#### __construct

ezcConstraintSimilarImage __construct( string $filename , [int $delta = 0] )

Constructor.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$filename` | string | Filename of the image to compare against.
`$delta` | int | Maximum delta between images.

#### evaluate

bool evaluate( mixed $other )

Evaluates the constraint for parameter $other. Returns TRUE if the constraint is met, FALSE otherwise.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$other` | mixed | Filename of the image to compare.

#### fail

void fail( mixed $other , string $description , [boolean $not = false] )

Creates the appropriate exception for the constraint which can be caught by the unit test system. This can be called if a call to evaluate() fails.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$other` | mixed | The value passed to evaluate() which failed the constraint check.
`$description` | string | A string with extra description of what was going on while the evaluation failed.
`$not` | boolean | Flag to indicate negation.

##### Exceptions:

Type | Description
--- | ---
`PHPUnit_Framework_ExpectationFailedException` |

#### toString

string toString( )

Provide test text

Documentation generated by phpDocumentor 1.4.3