PHP Класс Laravel\Lumen\Testing\TestCase

Наследование: extends PHPUnit_Framework_TestCas\PHPUnit_Framework_TestCase, use trait Laravel\Lumen\Testing\Concerns\MakesHttpRequests
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$app Laravel\Lumen\Application The application instance.
$baseUrl string The base URL to use while testing the application.
$beforeApplicationDestroyedCallbacks array The callbacks that should be run before the application is destroyed.

Открытые методы

Метод Описание
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 | null $driver = null ) : void Set the currently logged in user for the application.
createApplication ( ) : Symfony\Component\HttpKernel\HttpKernelInterface Creates the application.
expectsEvents ( array | string $events ) Specify a list of events that should be fired for the given operation.
setUp ( ) : void Setup the test environment.
tearDown ( ) : void Clean up the testing environment before the next test.

Защищенные методы

Метод Описание
beforeApplicationDestroyed ( callable $callback ) : void Register a callback to be run before the application is destroyed.
expectsJobs ( array | string $jobs ) Specify a list of jobs that should be dispatched for the given operation.
missingFromDatabase ( string $table, array $data, string | null $onConnection = null ) Assert that a given where condition does not exist in the database.
notSeeInDatabase ( string $table, array $data, string | null $onConnection = null ) Assert that a given where condition does not exist in the database.
refreshApplication ( ) : void Refresh the application instance.
seeInDatabase ( string $table, array $data, string | null $onConnection = null ) Assert that a given where condition exists in the database.
setUpTraits ( ) : void Boot the testing helper traits.
withoutEvents ( ) Mock the event dispatcher so all events are silenced.

Описание методов

actingAs() публичный Метод

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() публичный Метод

Call artisan command and return code.
public artisan ( string $command, array $parameters = [] ) : integer
$command string
$parameters array
Результат integer

be() публичный Метод

Set the currently logged in user for the application.
public be ( Illuminate\Contracts\Auth\Authenticatable $user, string | null $driver = null ) : void
$user Illuminate\Contracts\Auth\Authenticatable
$driver string | null
Результат void

beforeApplicationDestroyed() защищенный Метод

Register a callback to be run before the application is destroyed.
protected beforeApplicationDestroyed ( callable $callback ) : void
$callback callable
Результат void

createApplication() абстрактный публичный Метод

Needs to be implemented by subclasses.
abstract public createApplication ( ) : Symfony\Component\HttpKernel\HttpKernelInterface
Результат Symfony\Component\HttpKernel\HttpKernelInterface

expectsEvents() публичный Метод

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

expectsJobs() защищенный Метод

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

missingFromDatabase() защищенный Метод

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

notSeeInDatabase() защищенный Метод

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

refreshApplication() защищенный Метод

Refresh the application instance.
protected refreshApplication ( ) : void
Результат void

seeInDatabase() защищенный Метод

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

setUp() публичный Метод

Setup the test environment.
public setUp ( ) : void
Результат void

setUpTraits() защищенный Метод

Boot the testing helper traits.
protected setUpTraits ( ) : void
Результат void

tearDown() публичный Метод

Clean up the testing environment before the next test.
public tearDown ( ) : void
Результат void

withoutEvents() защищенный Метод

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

Описание свойств

$app защищенное свойство

The application instance.
protected Application,Laravel\Lumen $app
Результат Laravel\Lumen\Application

$baseUrl защищенное свойство

The base URL to use while testing the application.
protected string $baseUrl
Результат string

$beforeApplicationDestroyedCallbacks защищенное свойство

The callbacks that should be run before the application is destroyed.
protected array $beforeApplicationDestroyedCallbacks
Результат array