public function SkinrApiTestCase::testSkinrSkinHooks in Skinr 7.2
Test hook invocations for CRUD operations on skin configurations.
File
- tests/
skinr.test, line 482 - Tests for the Skinr module.
Class
- SkinrApiTestCase
- Tests API functionality.
Code
public function testSkinrSkinHooks() {
$skin = (object) array(
'theme' => 'skinr_test_subtheme',
'module' => 'block',
'element' => 'system__user-menu',
'skin' => 'skinr_test_subtheme',
'options' => array(
'option1',
'option2',
),
'status' => 1,
);
$_SESSION['skinr_test'] = array();
skinr_skin_save($skin);
$this
->assertHookMessage('skinr_test_skinr_skin_presave called');
$this
->assertHookMessage('skinr_test_skinr_skin_insert called');
$_SESSION['skinr_test'] = array();
$skin = skinr_skin_load($skin->sid);
$this
->assertHookMessage('skinr_test_skinr_skin_load called');
$_SESSION['skinr_test'] = array();
$skin = skinr_skin_load_unchanged($skin->sid);
$this
->assertHookMessage('skinr_test_skinr_skin_load called');
$_SESSION['skinr_test'] = array();
$skin->options = array(
'option3',
);
skinr_skin_save($skin);
$this
->assertHookMessage('skinr_test_skinr_skin_presave called');
$this
->assertHookMessage('skinr_test_skinr_skin_update called');
$_SESSION['skinr_test'] = array();
skinr_skin_delete($skin->sid);
$this
->assertHookMessage('skinr_test_skinr_skin_delete called');
}