ScriptFUSION\Porter\Specification\ImportSpecification::setMapping PHP Method

setMapping() final public method

final public setMapping ( ScriptFUSION\Mapper\Mapping $mapping = null )
$mapping ScriptFUSION\Mapper\Mapping
    public final function setMapping(Mapping $mapping = null)
    {
        $this->mapping = $mapping;
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 public function testMap()
 {
     $records = $this->porter->setMapper(\Mockery::mock(CollectionMapper::class)->shouldReceive('mapCollection')->with(\Mockery::type(\Iterator::class), $mapping = \Mockery::type(Mapping::class), \Mockery::any())->once()->andReturn(new \ArrayIterator($result = ['foo' => 'bar']))->getMock())->import($this->specification->setMapping(\Mockery::mock(Mapping::class)));
     self::assertInstanceOf(PorterRecords::class, $records);
     self::assertSame($result, iterator_to_array($records));
     /** @var MappedRecords $previous */
     self::assertInstanceOf(MappedRecords::class, $previous = $records->getPreviousCollection());
     self::assertNotSame($mapping, $previous->getMapping(), 'Mapping was not cloned.');
 }
All Usage Examples Of ScriptFUSION\Porter\Specification\ImportSpecification::setMapping