ScriptFUSIONTest\MockFactory::mockImportSpecification PHP Method

mockImportSpecification() public static method

public static mockImportSpecification ( ScriptFUSION\Porter\Provider\Resource\ProviderResource $resource = null )
$resource ScriptFUSION\Porter\Provider\Resource\ProviderResource
    public static function mockImportSpecification(ProviderResource $resource = null)
    {
        return \Mockery::mock(ImportSpecification::class, [$resource ?: \Mockery::mock(ProviderResource::class)]);
    }

Usage Example

Ejemplo n.º 1
0
 public function testImportTaggedResource()
 {
     $this->porter->registerProvider($provider = \Mockery::mock(Provider::class)->shouldReceive('fetch')->andReturn(new \ArrayIterator([$output = 'bar']))->getMock(), $tag = 'foo');
     $records = $this->porter->import(MockFactory::mockImportSpecification(MockFactory::mockResource($provider)->shouldReceive('getProviderTag')->andReturn($tag)->getMock()));
     self::assertSame($output, $records->current());
 }
All Usage Examples Of ScriptFUSIONTest\MockFactory::mockImportSpecification