PHP Класс Flugg\Responder\Tests\TestCase

Автор: Alexander Tømmerås ([email protected])
Наследование: extends Orchestra\Testbench\TestCase
Показать файл Открыть проект

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

Свойство Тип Описание
$responder Flugg\Responder\Responder An instance of the responder service responsible for generating API responses.
$schema Illuminate\Database\Schema\Builder Save an instance of the schema builder for easy access.

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

Метод Описание
setUp ( ) : void Setup the test environment.

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

Метод Описание
createModel ( array $attributes = [] ) : Model Creates a new adjustable model for testing purposes.
createTestController ( ) : Illuminate\Routing\Controller Creates a controller class with the RespondsWithJson trait.
createTestModelWithNoTransformer ( array $attributes = [] ) : Model Creates a new adjustable model without an attached transformer for testing purposes.
createTestModelWithNullTransformer ( array $attributes = [] ) : Model Creates a new adjustable model with a null transformer for testing purposes.
createTestTransformer ( ) : void Creates a new transformer for testing purposes.
getEnvironmentSetUp ( Illuminate\Foundation\Application $app ) : void Define environment setup.
getPackageProviders ( $app ) : array Get package service providers.
makeModel ( array $attributes = [] ) : Model Makes a new empty model for testing purposes.
makeModelWithResourceKey ( string $resourceKey ) : Model Makes a new empty model with a resource key set.
makeModelWithTransformer ( $transformer ) : Model Makes a new empty transformable model with a transformer set.
makeTransformer ( ) : Transformer Makes a new transformer for testing purposes.
mockBuilder ( array $data = null ) : Mockery\MockInterface Create a mock of the Eloquent builder with a mock of the [get] method which returns the given data.
mockBuilderWithPaginator ( array $data = null ) : Mockery\MockInterface Create a mock of the Eloquent builder with a mock of the [paginate] method which returns an instance of [\Illuminate\Pagination\LengthAwarePaginator].
mockPivot ( ) : Mockery\MockInterface Create a mock of a pivot.
mockRelation ( Collection | Model | null $data = null ) : Mockery\MockInterface Create a mock of an Eloquent relationship.
mockResourceFactory ( League\Fractal\Resource\ResourceInterface $resource ) : Mockery\MockInterface Create a mock of a resource factory.
mockResponder ( ) : Mockery\MockInterface Create a mock of the responder and binds it to the service container.
mockSuccessBuilder ( ) : Mockery\MockInterface Create a mock of a success response builder.
mockTranslator ( string $message ) : Mockery\MockInterface Create a mock of Laravel's translator and binds it to the service container.
rollbackTestMigrations ( ) : void Rollback migrations for tables only used for testing purposes.
runTestMigrations ( ) : void Run migrations for tables only used for testing purposes.
storeModel ( Model $model, array $attributes = [] ) : Model Stores an actual instance of an adjustable model to the database.

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

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

Creates a new adjustable model for testing purposes.
protected createModel ( array $attributes = [] ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

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

Creates a controller class with the RespondsWithJson trait.
protected createTestController ( ) : Illuminate\Routing\Controller
Результат Illuminate\Routing\Controller

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

Creates a new adjustable model without an attached transformer for testing purposes.
protected createTestModelWithNoTransformer ( array $attributes = [] ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

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

Creates a new adjustable model with a null transformer for testing purposes.
protected createTestModelWithNullTransformer ( array $attributes = [] ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

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

Creates a new transformer for testing purposes.
protected createTestTransformer ( ) : void
Результат void

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

Define environment setup.
protected getEnvironmentSetUp ( Illuminate\Foundation\Application $app ) : void
$app Illuminate\Foundation\Application
Результат void

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

Get package service providers.
protected getPackageProviders ( $app ) : array
Результат array

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

Makes a new empty model for testing purposes.
protected makeModel ( array $attributes = [] ) : Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

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

Makes a new empty model with a resource key set.
protected makeModelWithResourceKey ( string $resourceKey ) : Model
$resourceKey string
Результат Illuminate\Database\Eloquent\Model

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

Makes a new empty transformable model with a transformer set.
protected makeModelWithTransformer ( $transformer ) : Model
Результат Illuminate\Database\Eloquent\Model

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

Makes a new transformer for testing purposes.
protected makeTransformer ( ) : Transformer
Результат Flugg\Responder\Transformer

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

Create a mock of the Eloquent builder with a mock of the [get] method which returns the given data.
protected mockBuilder ( array $data = null ) : Mockery\MockInterface
$data array
Результат Mockery\MockInterface

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

Create a mock of the Eloquent builder with a mock of the [paginate] method which returns an instance of [\Illuminate\Pagination\LengthAwarePaginator].
protected mockBuilderWithPaginator ( array $data = null ) : Mockery\MockInterface
$data array
Результат Mockery\MockInterface

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

Create a mock of a pivot.
protected mockPivot ( ) : Mockery\MockInterface
Результат Mockery\MockInterface

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

Create a mock of an Eloquent relationship.
protected mockRelation ( Collection | Model | null $data = null ) : Mockery\MockInterface
$data Illuminate\Support\Collection | Illuminate\Database\Eloquent\Model | null
Результат Mockery\MockInterface

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

Create a mock of a resource factory.
protected mockResourceFactory ( League\Fractal\Resource\ResourceInterface $resource ) : Mockery\MockInterface
$resource League\Fractal\Resource\ResourceInterface
Результат Mockery\MockInterface

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

Create a mock of the responder and binds it to the service container.
protected mockResponder ( ) : Mockery\MockInterface
Результат Mockery\MockInterface

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

Create a mock of a success response builder.
protected mockSuccessBuilder ( ) : Mockery\MockInterface
Результат Mockery\MockInterface

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

Create a mock of Laravel's translator and binds it to the service container.
protected mockTranslator ( string $message ) : Mockery\MockInterface
$message string
Результат Mockery\MockInterface

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

Rollback migrations for tables only used for testing purposes.
protected rollbackTestMigrations ( ) : void
Результат void

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

Run migrations for tables only used for testing purposes.
protected runTestMigrations ( ) : void
Результат void

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

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

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

Stores an actual instance of an adjustable model to the database.
protected storeModel ( Model $model, array $attributes = [] ) : Model
$model Illuminate\Database\Eloquent\Model
$attributes array
Результат Illuminate\Database\Eloquent\Model

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

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

An instance of the responder service responsible for generating API responses.
protected Responder,Flugg\Responder $responder
Результат Flugg\Responder\Responder

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

Save an instance of the schema builder for easy access.
protected Builder,Illuminate\Database\Schema $schema
Результат Illuminate\Database\Schema\Builder