Esempio n. 1
0
 /**
  * Get mapper source data.
  *
  * @param string $name
  * @param array $options
  *
  * @return SourceDataInterface
  */
 public function getData($name, array $options = [])
 {
     if (false === isset($this->data[$name])) {
         $this->data[$name] = $this->factoryRegistry->getFactory($name)->create(new ParameterBag($options));
     }
     return $this->data[$name];
 }
Esempio n. 2
0
 public function testGetData_Success()
 {
     $dataMock = $this->getSourceDataMock();
     $this->dataFactoryRegistry->add($this->getSourceDataFactoryMock($dataMock), self::FACTORY_NAME);
     $this->assertEquals($dataMock, $this->provider->getData(self::FACTORY_NAME));
 }
 public function testGetFactory_Success()
 {
     $factoryMock = $this->getSourceDataFactoryMock();
     $this->registry->add($factoryMock, self::FACTORY_ALIAS);
     $this->assertEquals($factoryMock, $this->registry->getFactory(self::FACTORY_ALIAS));
 }