Projet

Général

Profil

Révision b0d73b57

Ajouté par Assos Assos il y a presque 9 ans

Revert media to 2.0-alpha4

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

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

Formats disponibles : Unified diff