PHP Class Flugg\Responder\Tests\Unit\ResourceFactoryTest

Author: Alexander Tømmerås ([email protected])
Inheritance: extends Flugg\Responder\Tests\TestCase
Datei anzeigen Open project: flugger/laravel-responder

Public Methods

Method Description
makeMethodShouldReturnCollectionResourceWhenGivenArray ( ) Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an array.
makeMethodShouldReturnCollectionResourceWhenGivenCollection ( ) Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an Illuminate collection.
makeMethodShouldReturnCollectionResourceWhenGivenPaginator ( ) Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an instance of [\Illuminate\Pagination\LengthAwarePaginator].
makeMethodShouldReturnCollectionResourceWhenGivenPivot ( ) Test that the [make] method returns a [\League\Fractal\Resource\Item] instance when you pass in an instance of [\Illuminate\Database\Eloquent\Relations\Pivot].
makeMethodShouldReturnCollectionResourceWhenGivenQueryBuilder ( ) Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an Eloquent query builder.
makeMethodShouldReturnCollectionResourceWhenGivenRelation ( ) Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an instance of [\Illuminate\Database\Eloquent\Relations\Relation].
makeMethodShouldReturnItemResourceWhenGivenModel ( ) Test that the [make] method returns a [\League\Fractal\Resource\Item] instance when you pass in a single model.
makeMethodShouldReturnNullResourceWhenGivenEmptyArray ( ) Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an empty array.
makeMethodShouldReturnNullResourceWhenGivenEmptyCollection ( ) Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an empty Illuminate collection.
makeMethodShouldReturnNullResourceWhenGivenEmptyPaginator ( ) Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an instance of [\Illuminate\Pagination\LengthAwarePaginator] with no data.
makeMethodShouldReturnNullResourceWhenGivenEmptyQueryBuilder ( ) Test that the [make] method returns a [\League\Fractal\Resource\NullResouce] instance when you pass in an Eloquent query builder which gives no results.
makeMethodShouldReturnNullResourceWhenGivenEmptyRelation ( ) Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an instance of [\Illuminate\Database\Eloquent\Relations\Relation] which contains no data.
makeMethodShouldReturnNullResourceWhenGivenNull ( ) Test that the [make] method returns a [\League\Fractal\Resource\NullResouce] instance when no data is given.
makeMethodShouldThrowExceptionWhenGivenInvalidData ( ) Test that the [make] method throws an [\InvalidArgumentException] when passing in data of unsupported data type.

Method Details

makeMethodShouldReturnCollectionResourceWhenGivenArray() public method

Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an array.

makeMethodShouldReturnCollectionResourceWhenGivenCollection() public method

Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an Illuminate collection.

makeMethodShouldReturnCollectionResourceWhenGivenPaginator() public method

Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an instance of [\Illuminate\Pagination\LengthAwarePaginator].

makeMethodShouldReturnCollectionResourceWhenGivenPivot() public method

Test that the [make] method returns a [\League\Fractal\Resource\Item] instance when you pass in an instance of [\Illuminate\Database\Eloquent\Relations\Pivot].

makeMethodShouldReturnCollectionResourceWhenGivenQueryBuilder() public method

Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an Eloquent query builder.

makeMethodShouldReturnCollectionResourceWhenGivenRelation() public method

Test that the [make] method returns a [\League\Fractal\Resource\Collection] instance when you pass in an instance of [\Illuminate\Database\Eloquent\Relations\Relation].

makeMethodShouldReturnItemResourceWhenGivenModel() public method

Test that the [make] method returns a [\League\Fractal\Resource\Item] instance when you pass in a single model.

makeMethodShouldReturnNullResourceWhenGivenEmptyArray() public method

Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an empty array.

makeMethodShouldReturnNullResourceWhenGivenEmptyCollection() public method

Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an empty Illuminate collection.

makeMethodShouldReturnNullResourceWhenGivenEmptyPaginator() public method

Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an instance of [\Illuminate\Pagination\LengthAwarePaginator] with no data.

makeMethodShouldReturnNullResourceWhenGivenEmptyQueryBuilder() public method

Test that the [make] method returns a [\League\Fractal\Resource\NullResouce] instance when you pass in an Eloquent query builder which gives no results.

makeMethodShouldReturnNullResourceWhenGivenEmptyRelation() public method

Test that the [make] method returns a [\League\Fractal\Resource\NullResource] instance when you pass in an instance of [\Illuminate\Database\Eloquent\Relations\Relation] which contains no data.

makeMethodShouldReturnNullResourceWhenGivenNull() public method

Test that the [make] method returns a [\League\Fractal\Resource\NullResouce] instance when no data is given.

makeMethodShouldThrowExceptionWhenGivenInvalidData() public method

Test that the [make] method throws an [\InvalidArgumentException] when passing in data of unsupported data type.