Commit d91c4456 authored by Chris Green's avatar Chris Green Committed by vlad.dancer
Browse files

Issue #3295859 by trackleft2: Add some tests for common use-cases

parent 02a869de
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -21,5 +21,8 @@
  "support": {
    "issues": "https://www.drupal.org/project/issues/intelligencebank",
    "source": "http://cgit.drupalcode.org/intelligencebank"
  },
  "require-dev": {
    "drupal/entity_browser": "^2.8"
  }
}

tests/TESTING.md

0 → 100644
+23 −0
Original line number Diff line number Diff line
# Notes about testing in Gitpod using the DrupalPod browser plugin.

## Using DrupalPod
[How to install DrupalPod](https://github.com/shaal/DrupalPod).

## Testing

You must download entity_browser.
`ddev composer require drupal/entity_browser`
You can test using a PHPUnit group
`ddev phpunit --group intelligencebank`

The test module relies heavily on the standard drupal install profile for the default media types.
https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/profiles/standard/config/optional/media.type.audio.yml
https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/profiles/standard/config/optional/media.type.document.yml
https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/profiles/standard/config/optional/media.type.image.yml
https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/profiles/standard/config/optional/media.type.video.yml


To enable the test module intelligencebank_test manually, you can add
`$settings['extension_discovery_scan_tests'] = TRUE;` to your settings.php file.
Then, enable the module as you normally would.
`ddev drush en -y intelligencebank_test`
+29 −0
Original line number Diff line number Diff line
langcode: en
status: true
dependencies:
  config:
    - media.type.ib_dam_embed
  module:
    - ib_dam_media
    - media
  enforced:
    module:
      - intelligencebank_test
name: search_ib_dam_test
label: 'Search IB DAM Test'
display: standalone
display_configuration:
  path: /admin/content/media/ibdam-test-form
selection_display: no_display
selection_display_configuration: {  }
widget_selector: single
widget_selector_configuration: {  }
widgets:
  7204a225-7d17-466c-884b-7e6a3b504feb:
    id: ib_dam_search
    uuid: 7204a225-7d17-466c-884b-7e6a3b504feb
    label: ib_dam_search_test
    weight: 1
    settings:
      submit_text: 'Select entities test'
      upload_location: 'public://intelligencebank-test'
+13 −0
Original line number Diff line number Diff line
media_types:
  image:
    source_type: image
    media_type: image
  audio:
    source_type: audio
    media_type: audio
  video:
    source_type: video
    media_type: video
  file:
    source_type: file
    media_type: document
+7 −0
Original line number Diff line number Diff line
name: 'IntelligenceBank test'
type: module
description: 'Support module for IntelligenceBank testing.'
package: Testing
version: VERSION
dependencies:
  - ib_dam:ib_dam_media
Loading