Menu

## MockObjectComparator extends ObjectComparator
in package

MockObjectComparator.php : 17

Compares PHPUnit\Framework\MockObject\MockObject instances for equality.

### Table of Contents

$exporter : Exporter
$factory : Factory
__construct() : mixed
accepts() : bool
  Returns whether the comparator can compare two values.
assertEquals() : mixed
  Asserts that two values are equal.
setFactory() : mixed
indent() : mixed
toArray() : array<string|int, mixed>
  Converts an object to an array containing all of its private, protected and public properties.

### Properties

#### $exporter

Comparator.php : 27
`protected Exporter $exporter`

#### $factory

Comparator.php : 22
`protected Factory $factory`

### Methods

#### __construct()

Comparator.php : 29
`public __construct() : mixed`

##### Return values

mixed —

#### accepts()

MockObjectComparator.php : 27

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()

Comparator.php : 60

Asserts that two values are equal.

`public abstract 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

##### Return values

mixed —

#### setFactory()

Comparator.php : 34
`public setFactory(Factory $factory) : mixed`

##### Parameters

$factory : Factory

##### Return values

mixed —

#### indent()

ArrayComparator.php : 137
`protected indent(mixed $lines) : mixed`

##### Parameters

$lines : mixed

##### Return values

mixed —

#### toArray()

MockObjectComparator.php : 40

Converts an object to an array containing all of its private, protected and public properties.

`protected toArray(object $object) : array<string|int, mixed>`

##### Parameters

$object : object

##### Return values

array<string|int, mixed> —

## Search results