PHP Trait Laravel\Lumen\Testing\ApplicationTrait

Show file Open project: ctrlaltdylan/MirrorMirror

Protected Properties

Property Type Description
$app Laravel\Lumen\Application The application instance.
$code integer The last code returned by artisan cli.

Public Methods

Method Description
actingAs ( Illuminate\Contracts\Auth\Authenticatable $user, string | null $driver = null ) Set the currently logged in user for the application.
artisan ( string $command, array $parameters = [] ) : integer Call artisan command and return code.
be ( Illuminate\Contracts\Auth\Authenticatable $user, string $driver = null ) : void Set the currently logged in user for the application.
expectsEvents ( array | dynamic $events ) Specify a list of events that should be fired for the given operation.
flushSession ( ) : void Flush all of the current session data.
seed ( string $class = 'DatabaseSeeder' ) : void Seed a given database connection.
session ( array $data ) : void Set the session to the given array.
withSession ( array $data ) Set the session to the given array.

Protected Methods

Method Description
expectsJobs ( array | dynamic $jobs ) Specify a list of jobs that should be dispatched for the given operation.
missingFromDatabase ( string $table, array $data ) Assert that a given where condition does not exist in the database.
notSeeInDatabase ( string $table, array $data ) Assert that a given where condition does not exist in the database.
refreshApplication ( ) : void Refresh the application instance.
seeInDatabase ( string $table, array $data ) Assert that a given where condition exists in the database.
startSession ( ) : void Start the session for the application.
withoutEvents ( ) Mock the event dispatcher so all events are silenced.

Method Details

actingAs() public method

Set the currently logged in user for the application.
public actingAs ( Illuminate\Contracts\Auth\Authenticatable $user, string | null $driver = null )
$user Illuminate\Contracts\Auth\Authenticatable
$driver string | null

artisan() public method

Call artisan command and return code.
public artisan ( string $command, array $parameters = [] ) : integer
$command string
$parameters array
return integer

be() public method

Set the currently logged in user for the application.
public be ( Illuminate\Contracts\Auth\Authenticatable $user, string $driver = null ) : void
$user Illuminate\Contracts\Auth\Authenticatable
$driver string
return void

expectsEvents() public method

These events will be mocked, so that handlers will not actually be executed.
public expectsEvents ( array | dynamic $events )
$events array | dynamic

expectsJobs() protected method

These jobs will be mocked, so that handlers will not actually be executed.
protected expectsJobs ( array | dynamic $jobs )
$jobs array | dynamic

flushSession() public method

Flush all of the current session data.
public flushSession ( ) : void
return void

missingFromDatabase() protected method

Assert that a given where condition does not exist in the database.
protected missingFromDatabase ( string $table, array $data )
$table string
$data array

notSeeInDatabase() protected method

Assert that a given where condition does not exist in the database.
protected notSeeInDatabase ( string $table, array $data )
$table string
$data array

refreshApplication() protected method

Refresh the application instance.
protected refreshApplication ( ) : void
return void

seeInDatabase() protected method

Assert that a given where condition exists in the database.
protected seeInDatabase ( string $table, array $data )
$table string
$data array

seed() public method

Seed a given database connection.
public seed ( string $class = 'DatabaseSeeder' ) : void
$class string
return void

session() public method

Set the session to the given array.
public session ( array $data ) : void
$data array
return void

startSession() protected method

Start the session for the application.
protected startSession ( ) : void
return void

withSession() public method

Set the session to the given array.
public withSession ( array $data )
$data array

withoutEvents() protected method

Mock the event dispatcher so all events are silenced.
protected withoutEvents ( )

Property Details

$app protected property

The application instance.
protected Application,Laravel\Lumen $app
return Laravel\Lumen\Application

$code protected property

The last code returned by artisan cli.
protected int $code
return integer