commit 693b0382ba31769859324fe470c48ea553faa662 Author: Alan Stanley Date: Mon Apr 15 14:28:07 2019 -0300 initial commit diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..11ebab87 --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/islandora_fits", + "type": "drupal-module", + "description": "Enables Technical Metadata derivative generation", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/islandora_fits", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/islandora_fits", + "source": "http://cgit.drupalcode.org/islandora_fits" + }, + "require": { } +} diff --git a/islandora_fits.info.yml b/islandora_fits.info.yml new file mode 100644 index 00000000..c67b2784 --- /dev/null +++ b/islandora_fits.info.yml @@ -0,0 +1,7 @@ +name: 'Islandora Fits' +type: module +description: 'Enables Technical Metadata derivative generation' +core: 8.x +package: 'Custom' +dependencies: + - islandora diff --git a/islandora_fits.module b/islandora_fits.module new file mode 100644 index 00000000..58eacc38 --- /dev/null +++ b/islandora_fits.module @@ -0,0 +1,24 @@ +' . t('About') . ''; + $output .= '

' . t('Enables Technical Metadata derivative generation') . '

'; + return $output; + + default: + } +} diff --git a/src/Plugin/Action/GenerateFitsDerivative.php b/src/Plugin/Action/GenerateFitsDerivative.php new file mode 100644 index 00000000..0206b9e9 --- /dev/null +++ b/src/Plugin/Action/GenerateFitsDerivative.php @@ -0,0 +1,58 @@ +getValue('mimetype')); + if ($exploded_mime[0] != 'application') { + $form_state->setErrorByName( + 'mimetype', + t('Please enter file mimetype (e.g. application/xml.)') + ); + } + } + +} diff --git a/tests/src/Functional/LoadTest.php b/tests/src/Functional/LoadTest.php new file mode 100644 index 00000000..5f39fe16 --- /dev/null +++ b/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +user = $this->drupalCreateUser(['administer site configuration']); + $this->drupalLogin($this->user); + } + + /** + * Tests that the home page loads with a 200 response. + */ + public function testLoad() { + $this->drupalGet(Url::fromRoute('')); + $this->assertSession()->statusCodeEquals(200); + } + +}