public static mockImportSpecification ( ScriptFUSION\Porter\Provider\Resource\ProviderResource $resource = null ) | ||
$resource | ScriptFUSION\Porter\Provider\Resource\ProviderResource |
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()); }
private function createSubImport($specification = null) { $this->subImport = $subImport = new SubImport($specification ?: MockFactory::mockImportSpecification()); $subImport->setPorter($this->porter = \Mockery::mock(Porter::class)->shouldReceive('import')->andReturn(new \EmptyIterator())->byDefault()->getMock()); }