Flugg\Responder\Tests\Unit\ResourceFactoryTest::makeMethodShouldReturnNullResourceWhenGivenEmptyRelation PHP Méthode

makeMethodShouldReturnNullResourceWhenGivenEmptyRelation() public méthode

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.
    public function makeMethodShouldReturnNullResourceWhenGivenEmptyRelation()
    {
        // Arrange...
        $data = $this->mockRelation(null);
        // Act...
        $resource = (new ResourceFactory())->make($data);
        // Assert...
        $this->assertInstanceOf(NullResource::class, $resource);
    }