Esempio n. 1
0
 public function testApplyAllDataUpdates()
 {
     /*reset versions*/
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Framework\\Module\\ResourceInterface')->setDbVersion('adminnotification_setup', false);
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Framework\\Module\\ResourceInterface')->setDataVersion('adminnotification_setup', false);
     $this->_model->deleteTableRow('core_resource', 'code', 'adminnotification_setup');
     $this->_model->getConnection()->dropTable($this->_model->getTable('adminnotification_inbox'));
     $this->_model->getConnection()->dropTable($this->_model->getTable('admin_system_messages'));
     /** @var \Magento\Framework\Cache\FrontendInterface $cache */
     $cache = $this->_objectManager->get('Magento\\Framework\\App\\Cache\\Type\\Config');
     $cache->clean();
     try {
         /* This triggers plugin to be executed */
         $this->dispatch('index/index');
     } catch (\Exception $e) {
         $this->fail("Impossible to continue other tests, because database is broken: {$e}");
     }
     try {
         $tableData = $this->_model->getConnection()->describeTable($this->_model->getTable('adminnotification_inbox'));
         $this->assertNotEmpty($tableData);
     } catch (\Exception $e) {
         $this->fail("Impossible to continue other tests, because database is broken: {$e}");
     }
     $this->assertNotEmpty($this->_model->getTableRow('core_resource', 'code', 'adminnotification_setup', 'version'));
     $this->assertNotEmpty($this->_model->getTableRow('core_resource', 'code', 'adminnotification_setup', 'data_version'));
 }
Esempio n. 2
0
 /**
  * @expectedException \Zend_Db_Statement_Exception
  */
 public function testDeleteTableRow()
 {
     $this->_model->deleteTableRow('core/resource', 'code', 'integration_test_fixture_setup');
 }