trait Illuminate / Foundation / Testing / Concerns / InteractsWithContainer
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

InteractsWithContainer

Properties

protected

$originalVite Vite |null

The original Vite handler.

Default: null
protected

$originalMix Mix |null

The original Laravel Mix handler.

Default: null

Methods

protected

swap ( $abstract , $instance ) : object

Register an instance of an object in the container.

Parameters

  • $abstract string
  • $instance object
protected

instance ( $abstract , $instance ) : object

Register an instance of an object in the container.

Parameters

  • $abstract string
  • $instance object
protected

mock ( $abstract , Closure $mock ) : Mockery\MockInterface

Mock an instance of an object in the container.

Parameters

protected

partialMock ( $abstract , Closure $mock ) : Mockery\MockInterface

Mock a partial instance of an object in the container.

Parameters

protected

spy ( $abstract , Closure $mock ) : Mockery\MockInterface

Spy an instance of an object in the container.

Parameters

protected

forgetMock ( $abstract ) : $this

Instruct the container to forget a previously mocked / spied instance of an object.

Parameters

  • $abstract string
protected

withoutVite ( ) : $this

Register an empty handler for Vite in the container.

protected

withVite ( ) : $this

Restore Vite in the container.

protected

withoutMix ( ) : $this

Register an empty handler for Laravel Mix in the container.

protected

withMix ( ) : $this

Restore Laravel Mix in the container.