public function testLoadConfig()
 {
     $reindexCommandMock = $this->getMock('\\Magento\\Indexer\\Console\\Command\\IndexerReindexCommand', [], [], '', false);
     $fileParserMock = $this->getMock('\\Magento\\Framework\\Xml\\Parser', ['load', 'xmlToArray'], [], '', false);
     $fileParserMock->expects($this->once())->method('xmlToArray')->willReturn(['config' => ['profile' => ['some_key' => 'some_value']]]);
     $fileParserMock->expects($this->once())->method('load')->with('config.file')->willReturn($fileParserMock);
     $this->model = new FixtureModel($reindexCommandMock, $fileParserMock);
     $this->model->loadConfig('config.file');
     $this->assertSame('some_value', $this->model->getValue('some_key'));
 }
示例#2
0
    public function testLoadConfig()
    {
        $reindexCommandMock = $this->getMock(
            '\Magento\Indexer\Console\Command\IndexerReindexCommand',
            [],
            [],
            '',
            false
        );

        $fileParserMock = $this->getMock('\Magento\Framework\XML\Parser', [], [], '', false);
        $fileParserMock->expects($this->once())
            ->method('load')
            ->willReturnSelf();

        $this->model = new FixtureModel($reindexCommandMock, $fileParserMock);
        $this->model->loadConfig('config.file');
    }
 public function testTest()
 {
     $reindexCommand = Bootstrap::getObjectManager()->get('Magento\\Indexer\\Console\\Command\\IndexerReindexCommand');
     $parser = Bootstrap::getObjectManager()->get('Magento\\Framework\\Xml\\Parser');
     $itfApplication = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap()->getApplication();
     $model = new FixtureModel($reindexCommand, $parser, $itfApplication->getInitParams());
     $model->loadConfig(__DIR__ . '/_files/small.xml');
     $model->initObjectManager();
     foreach ($model->loadFixtures()->getFixtures() as $fixture) {
         $fixture->execute();
     }
 }
 public function testTest()
 {
     $reindexCommand = Bootstrap::getObjectManager()->get('Magento\\Indexer\\Console\\Command\\IndexerReindexCommand');
     $parser = Bootstrap::getObjectManager()->get('Magento\\Framework\\Xml\\Parser');
     $itfApplication = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap()->getApplication();
     $model = new FixtureModel($reindexCommand, $parser, $itfApplication->getInitParams());
     $model->loadConfig(__DIR__ . '/_files/small.xml');
     $model->initObjectManager();
     foreach ($model->loadFixtures()->getFixtures() as $fixture) {
         //TODO: OrderFixture execution must be unskiped after implementation MAGETWO-47449
         if ($fixture->getPriority() == '135') {
             continue;
         }
         $fixture->execute();
     }
 }