Documentation

NumericComparator extends ScalarComparator
in package

Compares numerical values for equality.

Table of Contents

Properties

$exporter  : Exporter
$factory  : Factory

Methods

__construct()  : mixed
accepts()  : bool
Returns whether the comparator can compare two values.
assertEquals()  : mixed
Asserts that two values are equal.
setFactory()  : mixed
isInfinite()  : bool
isNan()  : bool

Properties

Methods

accepts()

Returns whether the comparator can compare two values.

public accepts(mixed $expected, mixed $actual) : bool
Parameters
$expected : mixed

The first value to compare

$actual : mixed

The second value to compare

Return values
bool

assertEquals()

Asserts that two values are equal.

public assertEquals(mixed $expected, mixed $actual[, float $delta = 0.0 ][, bool $canonicalize = false ][, bool $ignoreCase = false ]) : mixed
Parameters
$expected : mixed

First value to compare

$actual : mixed

Second value to compare

$delta : float = 0.0

Allowed numerical distance between two values to consider them equal

$canonicalize : bool = false

Arrays are sorted before comparison when set to true

$ignoreCase : bool = false

Case is ignored when set to true

Tags
throws
ComparisonFailure

isInfinite()

private isInfinite(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

isNan()

private isNan(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

        
On this page

Search results