コード例 #1
0
 /**
  * @return void
  */
 public function testCreate()
 {
     $adapterClassName = '\\Migration\\ResourceModel\\Adapter\\Mysql';
     $data = ['config' => ['key' => 'value']];
     $adapter = $this->getMock($adapterClassName, [], [], '', false);
     $this->config->expects($this->once())->method('getOption')->with('resource_adapter_class_name')->will($this->returnValue(null));
     $this->objectManager->expects($this->once())->method('create')->with('\\Migration\\ResourceModel\\Adapter\\Mysql', $data)->will($this->returnValue($adapter));
     $this->assertInstanceOf($adapterClassName, $this->adapterFactory->create($data));
 }
コード例 #2
0
 /**
  * @param AdapterFactory $adapterFactory
  * @param \Migration\Config $configReader
  * @param DocumentFactory $documentFactory
  * @param StructureFactory $structureFactory
  * @param Document\Collection $documentCollection
  */
 public function __construct(\Migration\ResourceModel\AdapterFactory $adapterFactory, \Migration\Config $configReader, \Migration\ResourceModel\DocumentFactory $documentFactory, \Migration\ResourceModel\StructureFactory $structureFactory, \Migration\ResourceModel\Document\Collection $documentCollection)
 {
     $this->configReader = $configReader;
     $this->adapter = $adapterFactory->create(['config' => $this->getResourceConfig()]);
     $this->documentFactory = $documentFactory;
     $this->structureFactory = $structureFactory;
     $this->documentCollection = $documentCollection;
 }