PHP Class Eloquent\Phony\Facade\AbstractFacade

Datei anzeigen Open project: eloquent/phony

Public Methods

Method Description
any ( ) : Eloquent\Phony\Matcher\Matcher Create a new matcher that matches anything.
anyOrder ( ) : Eloquent\Phony\Event\EventCollection Throws an exception unless at least one event is supplied.
anyOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection Throws an exception unless the supplied event sequence contains at least one event.
checkAnyOrder ( ) : Eloquent\Phony\Event\EventCollection | null Checks that at least one event is supplied.
checkAnyOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection | null Checks if the supplied event sequence contains at least one event.
checkInOrder ( ) : Eloquent\Phony\Event\EventCollection | null Checks if the supplied events happened in chronological order.
checkInOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection | null Checks if the supplied event sequence happened in chronological order.
equalTo ( mixed $value ) : Eloquent\Phony\Matcher\Matcher Create a new equal to matcher.
inOrder ( ) : Eloquent\Phony\Event\EventCollection Throws an exception unless the supplied events happened in chronological order.
inOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection Throws an exception unless the supplied event sequence happened in chronological order.
mock ( mixed $types = [] ) : Eloquent\Phony\Mock\Handle\InstanceHandle Create a new full mock, and return a handle.
mockBuilder ( mixed $types = [] ) : MockBuilder Create a new mock builder.
on ( Eloquent\Phony\Mock\Mock | Eloquent\Phony\Mock\Handle\InstanceHandle $mock ) : Eloquent\Phony\Mock\Handle\InstanceHandle Create a new handle.
onStatic ( Eloquent\Phony\Mock\Mock | Eloquent\Phony\Mock\Handle\Handle | ReflectionClas\ReflectionClass | string $class ) : StaticHandle Create a new static handle.
partialMock ( mixed $types = [], Arguments | array | null $arguments = [] ) : Eloquent\Phony\Mock\Handle\InstanceHandle Create a new partial mock, and return a handle.
restoreGlobalFunctions ( ) Restores the behavior of any functions in the global namespace that have been altered via spyGlobal() or stubGlobal().
setExportDepth ( integer $depth ) : integer Set the default export depth.
setUseColor ( boolean | null $useColor ) Turn on or off the use of ANSI colored output.
spy ( callable | null $callback = null ) : SpyVerifier Create a new spy.
spyGlobal ( string $function, string $namespace ) : SpyVerifier Create a spy of a function in the global namespace, and declare it as a function in another namespace.
stub ( callable | null $callback = null ) : StubVerifier Create a new stub.
stubGlobal ( string $function, string $namespace ) : StubVerifier Create a stub of a function in the global namespace, and declare it as a function in another namespace.
wildcard ( mixed $value = null, integer $minimumArguments, integer | null $maximumArguments = null ) : WildcardMatcher Create a new matcher that matches multiple arguments.

Method Details

any() public static method

Create a new matcher that matches anything.
public static any ( ) : Eloquent\Phony\Matcher\Matcher
return Eloquent\Phony\Matcher\Matcher The newly created matcher.

anyOrder() public static method

Throws an exception unless at least one event is supplied.
public static anyOrder ( ) : Eloquent\Phony\Event\EventCollection
return Eloquent\Phony\Event\EventCollection The result.

anyOrderSequence() public static method

Throws an exception unless the supplied event sequence contains at least one event.
public static anyOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection
$events mixed
return Eloquent\Phony\Event\EventCollection The result.

checkAnyOrder() public static method

Checks that at least one event is supplied.
public static checkAnyOrder ( ) : Eloquent\Phony\Event\EventCollection | null
return Eloquent\Phony\Event\EventCollection | null The result.

checkAnyOrderSequence() public static method

Checks if the supplied event sequence contains at least one event.
public static checkAnyOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection | null
$events mixed
return Eloquent\Phony\Event\EventCollection | null The result.

checkInOrder() public static method

Checks if the supplied events happened in chronological order.
public static checkInOrder ( ) : Eloquent\Phony\Event\EventCollection | null
return Eloquent\Phony\Event\EventCollection | null The result.

checkInOrderSequence() public static method

Checks if the supplied event sequence happened in chronological order.
public static checkInOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection | null
$events mixed
return Eloquent\Phony\Event\EventCollection | null The result.

equalTo() public static method

Create a new equal to matcher.
public static equalTo ( mixed $value ) : Eloquent\Phony\Matcher\Matcher
$value mixed The value to check.
return Eloquent\Phony\Matcher\Matcher The newly created matcher.

inOrder() public static method

Throws an exception unless the supplied events happened in chronological order.
public static inOrder ( ) : Eloquent\Phony\Event\EventCollection
return Eloquent\Phony\Event\EventCollection The result.

inOrderSequence() public static method

Throws an exception unless the supplied event sequence happened in chronological order.
public static inOrderSequence ( mixed $events ) : Eloquent\Phony\Event\EventCollection
$events mixed
return Eloquent\Phony\Event\EventCollection The result.

mock() public static method

Each value in $types can be either a class name, or an ad hoc mock definition. If only a single type is being mocked, the class name or definition can be passed without being wrapped in an array.
public static mock ( mixed $types = [] ) : Eloquent\Phony\Mock\Handle\InstanceHandle
$types mixed The types to mock.
return Eloquent\Phony\Mock\Handle\InstanceHandle A handle around the new mock.

mockBuilder() public static method

Each value in $types can be either a class name, or an ad hoc mock definition. If only a single type is being mocked, the class name or definition can be passed without being wrapped in an array.
public static mockBuilder ( mixed $types = [] ) : MockBuilder
$types mixed The types to mock.
return Eloquent\Phony\Mock\Builder\MockBuilder The mock builder.

on() public static method

Create a new handle.
public static on ( Eloquent\Phony\Mock\Mock | Eloquent\Phony\Mock\Handle\InstanceHandle $mock ) : Eloquent\Phony\Mock\Handle\InstanceHandle
$mock Eloquent\Phony\Mock\Mock | Eloquent\Phony\Mock\Handle\InstanceHandle The mock.
return Eloquent\Phony\Mock\Handle\InstanceHandle The newly created handle.

onStatic() public static method

Create a new static handle.
public static onStatic ( Eloquent\Phony\Mock\Mock | Eloquent\Phony\Mock\Handle\Handle | ReflectionClas\ReflectionClass | string $class ) : StaticHandle
$class Eloquent\Phony\Mock\Mock | Eloquent\Phony\Mock\Handle\Handle | ReflectionClas\ReflectionClass | string The class.
return Eloquent\Phony\Mock\Handle\StaticHandle The newly created handle.

partialMock() public static method

Each value in $types can be either a class name, or an ad hoc mock definition. If only a single type is being mocked, the class name or definition can be passed without being wrapped in an array. Omitting $arguments will cause the original constructor to be called with an empty argument list. However, if a null value is supplied for $arguments, the original constructor will not be called at all.
public static partialMock ( mixed $types = [], Arguments | array | null $arguments = [] ) : Eloquent\Phony\Mock\Handle\InstanceHandle
$types mixed The types to mock.
$arguments Eloquent\Phony\Call\Arguments | array | null The constructor arguments, or null to bypass the constructor.
return Eloquent\Phony\Mock\Handle\InstanceHandle A handle around the new mock.

restoreGlobalFunctions() public static method

Restores the behavior of any functions in the global namespace that have been altered via spyGlobal() or stubGlobal().
public static restoreGlobalFunctions ( )

setExportDepth() public static method

Negative depths are treated as infinite depth.
public static setExportDepth ( integer $depth ) : integer
$depth integer The depth.
return integer The previous depth.

setUseColor() public static method

Pass null to detect automatically.
public static setUseColor ( boolean | null $useColor )
$useColor boolean | null True to use color.

spy() public static method

Create a new spy.
public static spy ( callable | null $callback = null ) : SpyVerifier
$callback callable | null The callback, or null to create an anonymous spy.
return Eloquent\Phony\Spy\SpyVerifier The new spy.

spyGlobal() public static method

Create a spy of a function in the global namespace, and declare it as a function in another namespace.
public static spyGlobal ( string $function, string $namespace ) : SpyVerifier
$function string The name of the function in the global namespace.
$namespace string The namespace in which to create the new function.
return Eloquent\Phony\Spy\SpyVerifier The new spy.

stub() public static method

Create a new stub.
public static stub ( callable | null $callback = null ) : StubVerifier
$callback callable | null The callback, or null to create an anonymous stub.
return Eloquent\Phony\Stub\StubVerifier The new stub.

stubGlobal() public static method

Stubs created via this function do not forward to the original function by default. This differs from stubs created by other methods.
public static stubGlobal ( string $function, string $namespace ) : StubVerifier
$function string The name of the function in the global namespace.
$namespace string The namespace in which to create the new function.
return Eloquent\Phony\Stub\StubVerifier The new stub.

wildcard() public static method

Create a new matcher that matches multiple arguments.
public static wildcard ( mixed $value = null, integer $minimumArguments, integer | null $maximumArguments = null ) : WildcardMatcher
$value mixed The value to check for each argument.
$minimumArguments integer The minimum number of arguments.
$maximumArguments integer | null The maximum number of arguments.
return Eloquent\Phony\Matcher\WildcardMatcher The newly created wildcard matcher.