Overview

Namespaces

  • None
  • Peridot
    • Leo
      • Formatter
      • Interfaces
        • Assert
      • Matcher
        • Template
      • ObjectPath
      • Responder
  • PHP

Classes

  • Assert
  • Overview
  • Namespace
  • Class
  • Tree

Class Assert

Assert is a non-chainable, object oriented interface on top of a Leo Assertion.

Peridot\Leo\Interfaces\Assert uses Peridot\Leo\Interfaces\Assert\TypeAssertTrait, Peridot\Leo\Interfaces\Assert\ObjectAssertTrait, Peridot\Leo\Interfaces\Assert\CollectionAssertTrait
Namespace: Peridot\Leo\Interfaces
Package: Peridot\Leo\Interfaces
Located at Interfaces/Assert.php
Methods summary
public
# __construct( Peridot\Leo\Assertion $assertion = null )

Parameters

$assertion
$responder
public
# equal( mixed $actual, mixed $expected, string $message = "" )

Perform an a loose equality assertion.

Perform an a loose equality assertion.

Parameters

$actual
$expected
$message
public
# notEqual( mixed $actual, mixed $expected, string $message = "" )

Perform a negated loose equality assertion.

Perform a negated loose equality assertion.

Parameters

$actual
$expected
$message
public
# throws( callable $fn, mixed $exceptionType, string $exceptionMessage = "", string $message = "" )

Performs a throw assertion.

Performs a throw assertion.

Parameters

$fn
$exceptionType
$exceptionMessage
$message
public
# doesNotThrow( callable $fn, mixed $exceptionType, string $exceptionMessage = "", string $message = "" )

Performs a negated throw assertion.

Performs a negated throw assertion.

Parameters

$fn
$exceptionType
$exceptionMessage
$message
public
# ok( mixed $object, string $message = "" )

Perform an ok assertion.

Perform an ok assertion.

Parameters

$object
$message
public
# notOk( mixed $object, string $message = "" )

Perform a negated assertion.

Perform a negated assertion.

Parameters

$object
$message
public
# strictEqual( mixed $actual, mixed $expected, string $message = "" )

Perform a strict equality assertion.

Perform a strict equality assertion.

Parameters

$actual
$expected
$message
public
# notStrictEqual( mixed $actual, mixed $expected, string $message = "" )

Perform a negated strict equality assertion.

Perform a negated strict equality assertion.

Parameters

$actual
$expected
$message
public
# match( string $value, string $pattern, string $message = "" )

Perform a pattern assertion.

Perform a pattern assertion.

Parameters

$value
$pattern
$message
public
# notMatch( string $value, string $pattern, string $message = "" )

Perform a negated pattern assertion.

Perform a negated pattern assertion.

Parameters

$value
$pattern
$message
public
# operator( mixed $left, string $operator, mixed $right, string $message = "" )

Compare two values using the given operator.

Compare two values using the given operator.

Parameters

$left
$operator
$right
$message
public
# __call( mixed $method, mixed $args )

Defined to allow use of reserved words for methods.

Defined to allow use of reserved words for methods.

Parameters

$method
$args
Methods used from Peridot\Leo\Interfaces\Assert\TypeAssertTrait
isArray(), isBoolean(), isCallable(), isDouble(), isFalse(), isInteger(), isNotArray(), isNotBoolean(), isNotCallable(), isNotDouble(), isNotInteger(), isNotNull(), isNotNumeric(), isNotObject(), isNotResource(), isNotString(), isNull(), isNumeric(), isObject(), isResource(), isString(), isTrue(), notTypeOf(), typeOf()
Methods used from Peridot\Leo\Interfaces\Assert\ObjectAssertTrait
deepProperty(), deepPropertyNotVal(), deepPropertyVal(), isInstanceOf(), notDeepProperty(), notInstanceOf(), notProperty(), property(), propertyNotVal(), propertyVal()
Methods used from Peridot\Leo\Interfaces\Assert\CollectionAssertTrait
isIncluded(), lengthOf(), notInclude()
Magic methods summary
public mixed
# instanceOf( string $expected, string $message = "" )

Perform an instanceof assertion.

Perform an instanceof assertion.

Parameters

$expected
$message
$message

Returns

mixed
public mixed
# include( string $expected, string $message = "" )

Perform an inclusion assertion.

Perform an inclusion assertion.

Parameters

$expected
$message
$message

Returns

mixed
Properties summary
public static array $operators

An array of operators mapping to assertions.

An array of operators mapping to assertions.

# [ '==' => 'loosely->equal', '===' => 'equal', '>' => 'above', '>=' => 'least', '<' => 'below', '<=' => 'most', '!=' => 'not->loosely->equal', '!==' => 'not->equal' ]
protected Peridot\Leo\Assertion $assertion
#
Leo API documentation generated by ApiGen