public function FusionApplyApiTestCase::testFusionApplySkinHooks in Fusion Accelerator 7
Same name and namespace in other branches
- 7.2 fusion_apply/tests/fusion_apply.test \FusionApplyApiTestCase::testFusionApplySkinHooks()
Test hook invocations for CRUD operations on skin configurations.
File
- fusion_apply/
tests/ fusion_apply.test, line 324 - Tests for the Fusion Apply module.
Class
- FusionApplyApiTestCase
- Tests API functionality.
Code
public function testFusionApplySkinHooks() {
$skin = (object) array(
'theme' => 'fusion_apply_test_subtheme',
'module' => 'block',
'element' => 'system__user-menu',
'skin' => 'fusion_apply_test_subtheme',
'options' => array(
'option1',
'option2',
),
'status' => 1,
);
$_SESSION['fusion_apply_test'] = array();
fusion_apply_skin_save($skin);
$this
->assertHookMessage('fusion_apply_test_fusion_apply_skin_presave called');
$this
->assertHookMessage('fusion_apply_test_fusion_apply_skin_insert called');
$_SESSION['fusion_apply_test'] = array();
$skin = fusion_apply_skin_load($skin->sid);
$this
->assertHookMessage('fusion_apply_test_fusion_apply_skin_load called');
$_SESSION['fusion_apply_test'] = array();
$skin = fusion_apply_skin_load_unchanged($skin->sid);
$this
->assertHookMessage('fusion_apply_test_fusion_apply_skin_load called');
$_SESSION['fusion_apply_test'] = array();
$skin->options = array(
'option3',
);
fusion_apply_skin_save($skin);
$this
->assertHookMessage('fusion_apply_test_fusion_apply_skin_presave called');
$this
->assertHookMessage('fusion_apply_test_fusion_apply_skin_update called');
$_SESSION['fusion_apply_test'] = array();
fusion_apply_skin_delete($skin->sid);
$this
->assertHookMessage('fusion_apply_test_fusion_apply_skin_delete called');
}