PHP Class Eloquent\Phony\Facade\AbstractFacade

Afficher le fichier Open project: eloquent/phony

Méthodes publiques

Méthode 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 méthode

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

anyOrder() public static méthode

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

anyOrderSequence() public static méthode

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

checkAnyOrder() public static méthode

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

checkAnyOrderSequence() public static méthode

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

checkInOrder() public static méthode

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

checkInOrderSequence() public static méthode

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

equalTo() public static méthode

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

inOrder() public static méthode

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

inOrderSequence() public static méthode

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

mock() public static méthode

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.
Résultat Eloquent\Phony\Mock\Handle\InstanceHandle A handle around the new mock.

mockBuilder() public static méthode

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.
Résultat Eloquent\Phony\Mock\Builder\MockBuilder The mock builder.

on() public static méthode

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.
Résultat Eloquent\Phony\Mock\Handle\InstanceHandle The newly created handle.

onStatic() public static méthode

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.
Résultat Eloquent\Phony\Mock\Handle\StaticHandle The newly created handle.

partialMock() public static méthode

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.
Résultat Eloquent\Phony\Mock\Handle\InstanceHandle A handle around the new mock.

restoreGlobalFunctions() public static méthode

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

setExportDepth() public static méthode

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

setUseColor() public static méthode

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

spy() public static méthode

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

spyGlobal() public static méthode

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.
Résultat Eloquent\Phony\Spy\SpyVerifier The new spy.

stub() public static méthode

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

stubGlobal() public static méthode

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.
Résultat Eloquent\Phony\Stub\StubVerifier The new stub.

wildcard() public static méthode

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.
Résultat Eloquent\Phony\Matcher\WildcardMatcher The newly created wildcard matcher.