Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • CompositeExpectation
  • Configuration
  • Container
  • Expectation
  • ExpectationDirector
  • Loader
  • MethodCall
  • Mock
  • ReceivedMethodCalls
  • Recorder
  • Undefined
  • VerificationDirector
  • VerificationExpectation

Interfaces

  • Exception
  • ExpectationInterface
  • MockInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class Expectation

Mockery\Expectation implements Mockery\ExpectationInterface

Direct known subclasses

Mockery\VerificationExpectation
Namespace: Mockery
Located at Mockery/Expectation.php
Methods summary
public
# __construct( Mockery\MockInterface $mock, string $name )

Constructor

Constructor

Parameters

$mock
$name
public string
# __toString( string $name,…, array $args,… )

Return a string with the method name and arguments formatted

Return a string with the method name and arguments formatted

Parameters

$name,…
Name of the expected method
$args,…
List of arguments to the method

Returns

string
public mixed
# verifyCall( array $args )

Verify the current call, i.e. that the given arguments match those of this expectation

Verify the current call, i.e. that the given arguments match those of this expectation

Parameters

$args

Returns

mixed
protected mixed
# _setValues( array $args,… )

Sets public properties with queued values to the mock object

Sets public properties with queued values to the mock object

Parameters

$args,…

Returns

mixed
protected mixed
# _getReturnValue( array $args )

Fetch the return value for the matching args

Fetch the return value for the matching args

Parameters

$args

Returns

mixed
public boolean
# isEligible( )

Checks if this expectation is eligible for additional calls

Checks if this expectation is eligible for additional calls

Returns

boolean
public boolean
# isCallCountConstrained( )

Check if there is a constraint on call count

Check if there is a constraint on call count

Returns

boolean
public
# validateOrder( )

Verify call order

Verify call order

public boolean
# verify( )

Verify this expectation

Verify this expectation

Returns

boolean
public boolean
# matchArgs( array $args )

Check if passed arguments match an argument expectation

Check if passed arguments match an argument expectation

Parameters

$args

Returns

boolean
protected boolean
# _matchArg( array $expected, & $actual )

Check if passed argument matches an argument expectation

Check if passed argument matches an argument expectation

Parameters

$expected
$args
$actual

Returns

boolean
public Mockery\Expectation
# with( )

Expected argument setter for the expectation

Expected argument setter for the expectation

Returns

Mockery\Expectation
public Mockery\Expectation
# withArgs( array $args )

Expected arguments for the expectation passed as an array

Expected arguments for the expectation passed as an array

Parameters

$args

Returns

Mockery\Expectation
public Mockery\Expectation
# withNoArgs( )

Set with() as no arguments expected

Set with() as no arguments expected

Returns

Mockery\Expectation
public Mockery\Expectation
# withAnyArgs( )

Set expectation that any arguments are acceptable

Set expectation that any arguments are acceptable

Returns

Mockery\Expectation
public Mockery\Expectation
# andReturn( )

Set a return value, or sequential queue of return values

Set a return value, or sequential queue of return values

Returns

Mockery\Expectation

Implementation of

Mockery\ExpectationInterface::andReturn()
public Mockery\Expectation
# andReturnSelf( )

Return this mock, like a fluent interface

Return this mock, like a fluent interface

Returns

Mockery\Expectation
public Mockery\Expectation
# andReturnValues( array $values )

Set a sequential queue of return values with an array

Set a sequential queue of return values with an array

Parameters

$values

Returns

Mockery\Expectation
public Mockery\Expectation
# andReturnUsing( )

Set a closure or sequence of closures with which to generate return values. The arguments passed to the expected method are passed to the closures as parameters.

Set a closure or sequence of closures with which to generate return values. The arguments passed to the expected method are passed to the closures as parameters.

Returns

Mockery\Expectation
public Mockery\Expectation
# andReturnUndefined( )

Return a self-returning black hole object.

Return a self-returning black hole object.

Returns

Mockery\Expectation
public Mockery\Expectation
# andReturnNull( )

Return null. This is merely a language construct for Mock describing.

Return null. This is merely a language construct for Mock describing.

Returns

Mockery\Expectation
public Mockery\Expectation
# andThrow( string $exception, string $message = '', integer $code = 0, Mockery\Exception $previous = null )

Set Exception class and arguments to that class to be thrown

Set Exception class and arguments to that class to be thrown

Parameters

$exception
$message
$code
$previous

Returns

Mockery\Expectation
public Mockery\Expectation
# andThrowExceptions( array $exceptions )

Set Exception classes to be thrown

Set Exception classes to be thrown

Parameters

$exceptions

Returns

Mockery\Expectation
public Mockery\Expectation
# andSet( string $name, mixed $value )

Register values to be set to a public property each time this expectation occurs

Register values to be set to a public property each time this expectation occurs

Parameters

$name
$value

Returns

Mockery\Expectation
public Mockery\Expectation
# set( string $name, mixed $value )

Alias to andSet(). Allows the natural English construct - set('foo', 'bar')->andReturn('bar')

Alias to andSet(). Allows the natural English construct - set('foo', 'bar')->andReturn('bar')

Parameters

$name
$value

Returns

Mockery\Expectation
public Mockery\Expectation
# zeroOrMoreTimes( )

Indicates this expectation should occur zero or more times

Indicates this expectation should occur zero or more times

Returns

Mockery\Expectation
public
# times( integer $limit = null )

Indicates the number of times this expectation should occur

Indicates the number of times this expectation should occur

Parameters

$limit
public Mockery\Expectation
# never( )

Indicates that this expectation is never expected to be called

Indicates that this expectation is never expected to be called

Returns

Mockery\Expectation
public Mockery\Expectation
# once( )

Indicates that this expectation is expected exactly once

Indicates that this expectation is expected exactly once

Returns

Mockery\Expectation
public Mockery\Expectation
# twice( )

Indicates that this expectation is expected exactly twice

Indicates that this expectation is expected exactly twice

Returns

Mockery\Expectation
public Mockery\Expectation
# atLeast( )

Sets next count validator to the AtLeast instance

Sets next count validator to the AtLeast instance

Returns

Mockery\Expectation
public Mockery\Expectation
# atMost( )

Sets next count validator to the AtMost instance

Sets next count validator to the AtMost instance

Returns

Mockery\Expectation
public
# between( integer $minimum, integer $maximum )

Shorthand for setting minimum and maximum constraints on call counts

Shorthand for setting minimum and maximum constraints on call counts

Parameters

$minimum
$maximum
public Mockery\Expectation
# ordered( string $group = null )

Indicates that this expectation must be called in a specific given order

Indicates that this expectation must be called in a specific given order

Parameters

$group
Name of the ordered group

Returns

Mockery\Expectation
public Mockery\Expectation
# globally( )

Indicates call order should apply globally

Indicates call order should apply globally

Returns

Mockery\Expectation
protected integer
# _defineOrdered( string $group, object $ordering )

Setup the ordering tracking on the mock or mock container

Setup the ordering tracking on the mock or mock container

Parameters

$group
$ordering

Returns

integer
public integer
# getOrderNumber( )

Return order number

Return order number

Returns

integer

Implementation of

Mockery\ExpectationInterface::getOrderNumber()
public Mockery\Expectation
# byDefault( )

Mark this expectation as being a default

Mark this expectation as being a default

Returns

Mockery\Expectation
public Mockery\MockInterface
# getMock( )

Return the parent mock of the expectation

Return the parent mock of the expectation

Returns

Mockery\MockInterface

Implementation of

Mockery\ExpectationInterface::getMock()
public Mockery\Expectation
# passthru( )

Flag this expectation as calling the original class method with the any provided arguments instead of using a return value queue.

Flag this expectation as calling the original class method with the any provided arguments instead of using a return value queue.

Returns

Mockery\Expectation
public
# __clone( )

Cloning logic

Cloning logic

public
# getName( )
Properties summary
protected object $_mock

Mock object to which this expectation belongs

Mock object to which this expectation belongs

# null
protected string $_name

Method name

Method name

# null
protected array $_expectedArgs

Arguments expected by this expectation

Arguments expected by this expectation

# array()
protected array $_countValidators

Count validator store

Count validator store

# array()
protected string $_countValidatorClass

The count validator class to use

The count validator class to use

# 'Mockery\CountValidator\Exact'
protected integer $_actualCount

Actual count of calls to this expectation

Actual count of calls to this expectation

# 0
protected mixed $_returnValue

Value to return from this expectation

Value to return from this expectation

# null
protected array $_returnQueue

Array of return values as a queue for multiple return sequence

Array of return values as a queue for multiple return sequence

# array()
protected array $_closureQueue

Array of closures executed with given arguments to generate a result to be returned

Array of closures executed with given arguments to generate a result to be returned

# array()
protected array $_setQueue

Array of values to be set when this expectation matches

Array of values to be set when this expectation matches

# array()
protected integer $_orderNumber

Integer representing the call order of this expectation

Integer representing the call order of this expectation

# null
protected integer $_globalOrderNumber

Integer representing the call order of this expectation on a global basis

Integer representing the call order of this expectation on a global basis

# null
protected boolean $_throw

Flag indicating that an exception is expected to be throw (not returned)

Flag indicating that an exception is expected to be throw (not returned)

# false
protected boolean $_globally

Flag indicating whether the order of calling is determined locally or globally

Flag indicating whether the order of calling is determined locally or globally

# false
protected boolean $_noArgsExpectation

Flag indicating we expect no arguments

Flag indicating we expect no arguments

# false
protected boolean $_passthru

Flag indicating if the return value should be obtained from the original class method instead of returning predefined values from the return queue

Flag indicating if the return value should be obtained from the original class method instead of returning predefined values from the return queue

# false
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen