Projet

Général

Profil

Révision 2b3c8cc1

Ajouté par Assos Assos il y a presque 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/media/tests/media.test
468 468
  }
469 469
}
470 470

  
471
/**
472
 * Tests the media hooks.
473
 */
474
class MediaHooksTestCase extends MediaFileFieldTestCase {
475
  public static function getInfo() {
476
    return array(
477
      'name' => 'Media hooks test',
478
      'description' => 'Tests the Media hooks.',
479
      'group' => 'Media',
480
    );
481
  }
482

  
483
  function setUp() {
484
    parent::setUp();
485
  }
486

  
487
  /**
488
   * Tests that the media browser hooks.
489
   */
490
  function testMediaBrowserHooks() {
491
    // Enable media_module_test.module's hook_media_browser_plugin_info()
492
    // implementation and ensure it is working as designed.
493
    variable_set('media_module_test_media_browser_plugin_info', TRUE);
494

  
495
    $this->drupalGet('media/browser');
496
    $this->assertRaw(t('Media module test'), 'Custom browser plugin found.');
497

  
498
    // Enable media_module_test.module's hook_media_browser_plugin_info_alter()
499
    // implementation and ensure it is working as designed.
500
    variable_set('media_module_test_media_browser_plugin_info_alter', TRUE);
501

  
502
    $this->drupalGet('media/browser');
503
    $this->assertRaw(t('Altered plugin title'), 'Custom browser plugin was successfully altered.');
504

  
505
    // Enable media_module_test.module's hook_media_browser_plugins_alter()
506
    // implementation and ensure it is working as designed.
507
    variable_set('media_module_test_media_browser_plugins_alter', TRUE);
508

  
509
    $this->drupalGet('media/browser');
510
    $this->assertRaw(t('Altered browser plugin output.'), 'Custom browser plugin was successfully altered before being rendered.');
511
  }
512
}
513

  
471 514
/**
472 515
 * Tests the media browser 'Library' tab.
473 516
 */
......
870 913
    $javascript = $this->drupalGet("node/add/$type_name");
871 914
    $field_widget = array(
872 915
        'elements' => array(
873
          '#edit-' . $field_name . '-' . LANGUAGE_NONE . '-0' => array(
916
          '#edit-' . $field_name . '-' . LANGUAGE_NONE . '-0-upload' => array(
874 917
            'global' => array(
875 918
              'types' => array(
876
                0 => 'image',
919
                'image' => 'image',
877 920
              ),
878 921
              'enabledPlugins' => array(),
879 922
              'schemes' => array(
880
                0 => 'public',
881
                1 => 'private',
923
                'public' => 'public',
882 924
              ),
883 925
              'file_directory' => '',
884 926
              'file_extensions' => 'txt',

Formats disponibles : Unified diff