You are here

function MediaHooksTestCase::testMediaBrowserHooks in D7 Media 7.2

Same name and namespace in other branches
  1. 7.4 tests/media.test \MediaHooksTestCase::testMediaBrowserHooks()
  2. 7.3 tests/media.test \MediaHooksTestCase::testMediaBrowserHooks()

Tests that the media browser hooks.

File

tests/media.test, line 490
Tests for media.module.

Class

MediaHooksTestCase
Tests the media hooks.

Code

function testMediaBrowserHooks() {

  // Enable media_module_test.module's hook_media_browser_plugin_info()
  // implementation and ensure it is working as designed.
  variable_set('media_module_test_media_browser_plugin_info', TRUE);
  $this
    ->drupalGet('media/browser');
  $this
    ->assertRaw(t('Media module test'), 'Custom browser plugin found.');

  // Enable media_module_test.module's hook_media_browser_plugin_info_alter()
  // implementation and ensure it is working as designed.
  variable_set('media_module_test_media_browser_plugin_info_alter', TRUE);
  $this
    ->drupalGet('media/browser');
  $this
    ->assertRaw(t('Altered plugin title'), 'Custom browser plugin was successfully altered.');

  // Enable media_module_test.module's hook_media_browser_plugins_alter()
  // implementation and ensure it is working as designed.
  variable_set('media_module_test_media_browser_plugins_alter', TRUE);
  $this
    ->drupalGet('media/browser');
  $this
    ->assertRaw(t('Altered browser plugin output.'), 'Custom browser plugin was successfully altered before being rendered.');
}