/**
  * «ависимость от добавлени¤
  * @after testUpdate
  */
 public function testDelete()
 {
     $this->_injectDutyCollector();
     $deleteResult = \CIBlock::Delete($this->_iblockId);
     $this->assertTrue($deleteResult, $this->errorMessage('iblock must be removed from the database'));
     $this->assertCount($this->_getCollectorFixes(DeleteProcess::className()), 3, $this->errorMessage('uninstall entries must be: section, property information, iblock'));
     $this->assertCount($sectionFixesList = $this->_getCollectorFixes(DeleteProcess::className(), IblockSectionHandler::className()), 1, $this->errorMessage('should be uninstall entries: Section'));
     $this->assertCount($propsFixesList = $this->_getCollectorFixes(DeleteProcess::className(), IblockPropertyHandler::className()), 1, $this->errorMessage('should be uninstall entries: Property'));
     $this->assertCount($iblockFixesList = $this->_getCollectorFixes(DeleteProcess::className(), IblockHandler::className()), 1, $this->errorMessage('should be uninstall entries: Iblock'));
     $sectionFixData = array_shift($sectionFixesList);
     $this->assertTrue(is_scalar($sectionFixData['data']), $this->errorMessage('data pack when you remove the section must be an identifier', array(':value' => self::exportValue($sectionFixData['data']))));
     $propFixData = array_shift($propsFixesList);
     $this->assertTrue(is_scalar($propFixData['data']), $this->errorMessage('data pack when you remove the property must be an identifier', array(':value' => self::exportValue($propFixData['data']))));
     $iblockFixData = array_shift($iblockFixesList);
     $this->assertTrue(is_scalar($iblockFixData['data']), $this->errorMessage('data pack when you remove the iblock must be an identifier', array(':value' => self::exportValue($iblockFixData['data']))));
     $this->assertNotEmpty($iblockFixData['originalData'], $this->errorMessage('data should be stored remotely information block'));
     // фиксаци¤ изменений
     Module::getInstance()->commitDutyChanges();
 }
Пример #2
0
 /**
  * Meta description uses handlers, been register
  * @return array
  */
 protected function handlers()
 {
     return array(IblockHandler::className() => array(self::FIX_CHANGES_ADD_KEY => array('iblock', 'OnAfterIBlockAdd'), self::FIX_CHANGES_BEFORE_CHANGE_KEY => array('iblock', 'OnBeforeIBlockUpdate'), self::FIX_CHANGES_AFTER_CHANGE_KEY => array('iblock', 'OnAfterIBlockUpdate'), self::FIX_CHANGES_BEFORE_DELETE_KEY => array('iblock', 'OnBeforeIBlockDelete'), self::FIX_CHANGES_AFTER_DELETE_KEY => array('iblock', 'OnIBlockDelete')), IblockPropertyHandler::className() => array(self::FIX_CHANGES_ADD_KEY => array('iblock', 'OnAfterIBlockPropertyAdd'), self::FIX_CHANGES_BEFORE_CHANGE_KEY => array('iblock', 'OnBeforeIBlockPropertyUpdate'), self::FIX_CHANGES_AFTER_CHANGE_KEY => array('iblock', 'OnAfterIBlockPropertyUpdate'), self::FIX_CHANGES_BEFORE_DELETE_KEY => array('iblock', 'OnBeforeIBlockPropertyDelete'), self::FIX_CHANGES_AFTER_DELETE_KEY => array('iblock', 'OnIBlockPropertyDelete')), IblockSectionHandler::className() => array(self::FIX_CHANGES_ADD_KEY => array('iblock', 'OnAfterIBlockSectionAdd'), self::FIX_CHANGES_BEFORE_CHANGE_KEY => array('iblock', 'OnBeforeIBlockSectionUpdate'), self::FIX_CHANGES_AFTER_CHANGE_KEY => array('iblock', 'OnAfterIBlockSectionUpdate'), self::FIX_CHANGES_BEFORE_DELETE_KEY => array('iblock', 'OnBeforeIBlockSectionDelete'), self::FIX_CHANGES_AFTER_DELETE_KEY => array('iblock', 'OnAfterIBlockSectionDelete')));
 }