Tripal
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest Class Reference
Inheritance diagram for Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest:
Inheritance graph
[legend]
Collaboration diagram for Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest:
Collaboration graph
[legend]

Public Member Functions

 testTripalImporterFormValidateLocalFile ()
 
 testTripalImporterFormValidateRemoteFile ()
 

Protected Member Functions

 setUp ()
 
 setMockManager ($annotation)
 

Protected Attributes

 $defaultTheme = 'stark'
 
 $mock_plugin
 
 $definitions
 
 $form
 
 $analysis_form
 
 $test_file
 

Static Protected Attributes

static $modules = ['system', 'user', 'file', 'tripal']
 

Detailed Description

Tests the base functionality for importers.

Cannot test actually implemented importers as those require database specific implementations.

@group TripalImporter

Member Function Documentation

◆ setMockManager()

Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest::setMockManager (   $annotation)
protected

HELPER: Creates a mock plugin + plugin manager.

◆ setUp()

Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest::setUp ( )
protected

{}

◆ testTripalImporterFormValidateLocalFile()

Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest::testTripalImporterFormValidateLocalFile ( )

Tests the validation of the local file element added by the Base Tripal Importer.

Specifically,

  • VALID: provide an existing local file, correct file format
  • ERROR: indicate a file which does not exist locally.

◆ testTripalImporterFormValidateRemoteFile()

Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest::testTripalImporterFormValidateRemoteFile ( )

Tests the validation of the remote file element added by the Base Tripal Importer.

Specifically,

  • VALID: provide a valid remote URL
  • ERROR: provide a badly formatted URI
  • ERROR: provide a correctly formatted but non-existent URI

Member Data Documentation

◆ $analysis_form

Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest::$analysis_form
protected
Initial value:
= [
'analysis_method' => [
'#title' => 'Gemstone Validation',
'#type' => 'select',
'#description' => 'Choose the validation methodology that proves these stones are authentic.',
'#required' => FALSE,
'#options' => [
'raman' => 'Raman spectroscopy',
'luminescence' => 'Luminescence',
'acid' => 'Acid Testing',
],
'#empty_option' => '- Select -',
],
]

◆ $definitions

Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest::$definitions
protected
Initial value:
= [
'id' => 'fakeImporterName',
'label' => 'Gemstone Loader',
'description' => 'Imports details on the incredible diversity of gemstones created by our earth into Chado.',
'file_types' => ["gem", "txt"],
'upload_description' => "Please provide a plain text, tab-delimited file of gemstone descriptions making sure to include the details which make them most unique and beautiful.",
'upload_title' => 'Gemstone Descriptions',
'use_analysis' => FALSE,
'require_analysis' => FALSE,
'button_text' => 'Import file',
'file_upload' => TRUE,
'file_local' => TRUE,
'file_remote' => TRUE,
'file_required' => TRUE,
'cardinality' => 1,
]

◆ $form

Drupal\Tests\tripal\Kernel\TripalImporter\TripalImporterFormSubmitTest::$form
protected
Initial value:
= [
'gemstone_composition' => [
'#title' => 'Chemical Composition',
'#type' => 'select',
'#description' => 'Choose the chemical composition that all gems in your input file fall into.',
'#required' => FALSE,
'#options' => [
'borate' => 'Borate (e.g. Howlite)',
'carbon' => 'Carbon (e.g. Diamond)',
'carbonate' => 'Carbonate (e.g. Azurite, Calcite, Malachite)',
'halide' => 'Halide (e.g. Fluorite)',
'igneous' => 'Igneous Rock (e.g. obsidian, lava stone)',
'organic' => 'Organic (e.g. Amber, Pearl)',
'silicate' => 'Silicate (e.g. Amazonite, Danburite, Lepidolite)'
],
'#empty_option' => '- Select -',
],
]

The documentation for this class was generated from the following file: