1 common.test CommonBackdropRenderTestCase::testBackdropRenderInvalidKeys()

Test rendering elements with invalid keys.

File

core/modules/simpletest/tests/common.test, line 2202
Tests for common.inc functionality.

Class

CommonBackdropRenderTestCase
Tests for backdrop_render().

Code

function testBackdropRenderInvalidKeys() {
  $error = array(
    '%type' => 'User error',
    '!message' => '"child" is an invalid render array key',
    '%function' => 'element_children()',
  );
  $message = t('%type: !message in %function (line ', $error);

  config_set('system.core', 'error_level', ERROR_REPORTING_DISPLAY_ALL);
  $this->backdropGet('common-test/backdrop-render-invalid-keys');
  $this->assertResponse(200, t('Received expected HTTP status code.'));
  $this->assertRaw($message, t('Found error message: !message.', array('!message' => $message)));
}