public function testNoFixtureConfigValue() { $attributeMock = $this->getMock('Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute', [], [], '', false); $attributeMock->expects($this->never())->method('save'); $objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManager\\ObjectManager', [], [], '', false); $objectManagerMock->expects($this->never())->method('create')->with($this->equalTo('Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute'))->willReturn($attributeMock); $this->fixtureModelMock->expects($this->never())->method('getObjectManager')->will($this->returnValue($objectManagerMock)); $this->fixtureModelMock->expects($this->once())->method('getValue')->willReturn(false); $this->model->execute(); }
public function testNoFixtureConfigValue() { $csvImportHandlerMock = $this->getMock('Magento\\TaxImportExport\\Model\\Rate\\CsvImportHandler', [], [], '', false); $csvImportHandlerMock->expects($this->never())->method('importFromCsvFile'); $objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManager\\ObjectManager', [], [], '', false); $objectManagerMock->expects($this->never())->method('create')->willReturn($csvImportHandlerMock); $this->fixtureModelMock->expects($this->never())->method('getObjectManager')->willReturn($objectManagerMock); $this->fixtureModelMock->expects($this->once())->method('getValue')->willReturn(false); $this->model->execute(); }
public function testNoFixtureConfigValue() { $ruleMock = $this->getMock('\\Magento\\SalesRule\\Model\\Rule', [], [], '', false); $ruleMock->expects($this->never())->method('save'); $objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManager\\ObjectManager', [], [], '', false); $objectManagerMock->expects($this->never())->method('get')->with($this->equalTo('Magento\\SalesRule\\Model\\Rule'))->willReturn($ruleMock); $this->fixtureModelMock->expects($this->never())->method('getObjectManager')->willReturn($objectManagerMock); $this->fixtureModelMock->expects($this->once())->method('getValue')->willReturn(false); $this->model->execute(); }
public function testNoFixtureConfigValue() { $cacheInterfaceMock = $this->getMock('Magento\\Framework\\App\\CacheInterface', [], [], '', false); $cacheInterfaceMock->expects($this->never())->method('clean'); $objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManager\\ObjectManager', [], [], '', false); $objectManagerMock->expects($this->never())->method('get')->willReturn($cacheInterfaceMock); $this->fixtureModelMock->expects($this->never())->method('getObjectManager')->willReturn($objectManagerMock); $this->fixtureModelMock->expects($this->once())->method('getValue')->willReturn(false); $this->model->execute(); }
public function testNoFixtureConfigValue() { $importMock = $this->getMock('\\Magento\\ImportExport\\Model\\Import', [], [], '', false); $importMock->expects($this->never())->method('validateSource'); $importMock->expects($this->never())->method('importSource'); $objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManager\\ObjectManager', [], [], '', false); $objectManagerMock->expects($this->never())->method('create')->with($this->equalTo('Magento\\ImportExport\\Model\\Import'))->willReturn($importMock); $this->fixtureModelMock->expects($this->never())->method('getObjectManager')->will($this->returnValue($objectManagerMock)); $this->fixtureModelMock->expects($this->once())->method('getValue')->willReturn(false); $this->model->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) { $fixture->execute(); } }
public function testNoFixtureConfigValue() { $storeMock = $this->getMock('\\Magento\\Store\\Model\\Store', [], [], '', false); $storeMock->expects($this->never())->method('save'); $storeManagerMock = $this->getMock('Magento\\Store\\Model\\StoreManager', [], [], '', false); $storeManagerMock->expects($this->never())->method('getDefaultStoreView')->willReturn($storeMock); $objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManager\\ObjectManager', [], [], '', false); $objectManagerMock->expects($this->never())->method('create')->with($this->equalTo('Magento\\Store\\Model\\StoreManager'))->willReturn($storeManagerMock); $this->fixtureModelMock->expects($this->never())->method('getObjectManager')->willReturn($objectManagerMock); $this->fixtureModelMock->expects($this->exactly(3))->method('getValue')->willReturn(false); $this->model->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(); } }
public function testNoFixtureConfigValue() { $connectionMock = $this->getMockForAbstractClass('\\Magento\\Framework\\DB\\Adapter\\AdapterInterface', [], '', true, true, true, []); $connectionMock->expects($this->never())->method('query'); $resourceMock = $this->getMock('Magento\\Framework\\App\\ResourceConnection', [], [], '', false); $resourceMock->expects($this->never())->method('getConnection')->with($this->equalTo('write'))->willReturn($connectionMock); $objectManagerMock = $this->getMock('Magento\\Framework\\ObjectManager\\ObjectManager', [], [], '', false); $objectManagerMock->expects($this->never())->method('get')->with($this->equalTo('Magento\\Framework\\App\\ResourceConnection'))->willReturn($resourceMock); $this->fixtureModelMock->expects($this->never())->method('getObjectManagerMock')->willReturn($objectManagerMock); $this->fixtureModelMock->expects($this->once())->method('getValue')->willReturn(false); $this->model->execute(); }
public function testGetValue() { $this->assertSame(null, $this->model->getValue('null_key')); }
public function testSkipReindexOption() { $this->fixtureModel->expects($this->never())->method('reindex'); $commandTester = new CommandTester($this->command); $commandTester->execute(['profile' => 'path_to_profile.xml', '--skip-reindex' => true]); }