You are here

function UtilHelperTestCase::testRegisterUniqueShutdownFunction in Helper 7

File

tests/UtilHelperTestCase.test, line 19

Class

UtilHelperTestCase

Code

function testRegisterUniqueShutdownFunction() {
  $callbacks_before = drupal_register_shutdown_function();
  UtilHelper::registerUniqueShutdownFunction(array(
    'UtilHelperTestCase',
    'doNothing',
  ));
  UtilHelper::registerUniqueShutdownFunction(array(
    'UtilHelperTestCase',
    'doNothing',
  ), 1);
  UtilHelper::registerUniqueShutdownFunction(array(
    'UtilHelperTestCase',
    'doNothing',
  ), 1);
  UtilHelper::registerUniqueShutdownFunction(array(
    'UtilHelperTestCase',
    'doNothing',
  ), '1');
  UtilHelper::registerUniqueShutdownFunction(array(
    'UtilHelperTestCase',
    'doNothing',
  ), '1');
  UtilHelper::registerUniqueShutdownFunction(array(
    'UtilHelperTestCase',
    'doNothing',
  ), TRUE);
  $callbacks_after = drupal_register_shutdown_function();
  $this
    ->assertIdentical(count($callbacks_after) - count($callbacks_before), 4);
}