function RegistrationAPITestCase::testHookStatus in Entity Registration 7
Same name and namespace in other branches
- 8.2 tests/registration.test \RegistrationAPITestCase::testHookStatus()
- 7.2 tests/registration.test \RegistrationAPITestCase::testHookStatus()
Test hook_registration_status().
File
- tests/
registration.test, line 620 - Tests for the Registration module
Class
Code
function testHookStatus() {
// Testing host status, no hook.
$this
->setHostEntitySettings(array(
'status' => 1,
));
$this
->assertTrue(registration_status($this->host_entity_type, $this->host_entity_id, TRUE), t('Host entity status is open.'), 'Registration');
// Host main status is opened, hook closes.
variable_set('registration_test_api_registration_status_alter', FALSE);
$this
->assertFalse(registration_status($this->host_entity_type, $this->host_entity_id, TRUE), t('Host entity status is open, hook overrides'), 'Registration');
// Hook should still be invoked if main status is closed.
$this
->setHostEntitySettings(array(
'status' => 0,
));
variable_set('registration_test_api_registration_status_alter', TRUE);
$this
->assertTrue(registration_status($this->host_entity_type, $this->host_entity_id, TRUE), t('Host entity status is closed, hook overrides.'), 'Registration');
}