From f36b3ead517a9ae26d5ce674c99fdd89bed008fa Mon Sep 17 00:00:00 2001 From: dannylamb Date: Wed, 18 Dec 2019 17:56:05 +0000 Subject: [PATCH] Fixing tests --- ...io.info.yml => islandora_audio.schema.yml} | 3 +++ .../GenerateAudioDerivativeTest.php | 1 + ...ge.info.yml => islandora_image.schema.yml} | 3 +++ .../GenerateImageDerivativeTest.php | 1 + .../islandora_text_extraction.install | 23 ------------------- .../tests/src/Functional/LoadTest.php | 6 ++--- ...eo.info.yml => islandora_video.schema.yml} | 3 +++ .../GenerateVideoDerivativeTest.php | 6 ++--- src/Form/IslandoraSettingsForm.php | 4 ++-- 9 files changed, 18 insertions(+), 32 deletions(-) rename modules/islandora_audio/config/schema/{islandora_audio.info.yml => islandora_audio.schema.yml} (88%) rename modules/islandora_image/config/schema/{islandora_image.info.yml => islandora_image.schema.yml} (88%) delete mode 100644 modules/islandora_text_extraction/islandora_text_extraction.install rename modules/islandora_video/config/schema/{islandora_video.info.yml => islandora_video.schema.yml} (88%) diff --git a/modules/islandora_audio/config/schema/islandora_audio.info.yml b/modules/islandora_audio/config/schema/islandora_audio.schema.yml similarity index 88% rename from modules/islandora_audio/config/schema/islandora_audio.info.yml rename to modules/islandora_audio/config/schema/islandora_audio.schema.yml index 47d08ee3..5f09740a 100644 --- a/modules/islandora_audio/config/schema/islandora_audio.info.yml +++ b/modules/islandora_audio/config/schema/islandora_audio.schema.yml @@ -8,6 +8,9 @@ action.configuration.generate_audio_derivative: event: type: text label: 'Event Type' + destination_media_type: + type: text + label: 'Destination media type' source_term_uri: type: text label: 'Source term uri' diff --git a/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php b/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php index bcd78f70..88fb38ce 100644 --- a/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php +++ b/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php @@ -46,6 +46,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase { $this->getSession()->getPage()->fillField('edit-label', "Generate audio test derivative"); $this->getSession()->getPage()->fillField('edit-id', "generate_audio_test_derivative"); $this->getSession()->getPage()->fillField('edit-queue', "generate-audio-test-derivative"); + $this->getSession()->getPage()->fillField('edit-destination-media-type', $this->testMediaType->label()); $this->getSession()->getPage()->fillField("edit-source-term", $this->preservationMasterTerm->label()); $this->getSession()->getPage()->fillField("edit-derivative-term", $this->serviceFileTerm->label()); $this->getSession()->getPage()->fillField('edit-mimetype', "audio/mpeg"); diff --git a/modules/islandora_image/config/schema/islandora_image.info.yml b/modules/islandora_image/config/schema/islandora_image.schema.yml similarity index 88% rename from modules/islandora_image/config/schema/islandora_image.info.yml rename to modules/islandora_image/config/schema/islandora_image.schema.yml index 350516d0..687e7c11 100644 --- a/modules/islandora_image/config/schema/islandora_image.info.yml +++ b/modules/islandora_image/config/schema/islandora_image.schema.yml @@ -8,6 +8,9 @@ action.configuration.generate_image_derivative: event: type: text label: 'Event Type' + destination_media_type: + type: text + label: 'Destination media type' source_term_uri: type: text label: 'Source term uri' diff --git a/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php b/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php index c917ba6c..8c554186 100644 --- a/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php +++ b/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php @@ -48,6 +48,7 @@ class GenerateImageDerivativeTest extends GenerateDerivativeTestBase { $this->getSession()->getPage()->fillField('edit-label', "Generate image test derivative"); $this->getSession()->getPage()->fillField('edit-id', "generate_image_test_derivative"); $this->getSession()->getPage()->fillField('edit-queue', "generate-image-test-derivative"); + $this->getSession()->getPage()->fillField('edit-destination-media-type', $this->testMediaType->label()); $this->getSession()->getPage()->fillField("edit-source-term", $this->preservationMasterTerm->label()); $this->getSession()->getPage()->fillField("edit-derivative-term", $this->serviceFileTerm->label()); $this->getSession()->getPage()->fillField('edit-mimetype', "image/jpeg"); diff --git a/modules/islandora_text_extraction/islandora_text_extraction.install b/modules/islandora_text_extraction/islandora_text_extraction.install deleted file mode 100644 index 95c857f9..00000000 --- a/modules/islandora_text_extraction/islandora_text_extraction.install +++ /dev/null @@ -1,23 +0,0 @@ -getSettings(); - $extensions = $fieldSettings['file_extensions']; - if (!strpos($extensions, 'txt')) { - $fieldSettings['file_extensions'] .= ' txt'; - $field->set('settings', $fieldSettings); - $field->save(); - } -} diff --git a/modules/islandora_text_extraction/tests/src/Functional/LoadTest.php b/modules/islandora_text_extraction/tests/src/Functional/LoadTest.php index 3cdeca91..31dca62c 100644 --- a/modules/islandora_text_extraction/tests/src/Functional/LoadTest.php +++ b/modules/islandora_text_extraction/tests/src/Functional/LoadTest.php @@ -3,14 +3,14 @@ namespace Drupal\Tests\islandora_text_extraction\Functional; use Drupal\Core\Url; -use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\islandora\Functional\IslandoraFunctionalTestBase; /** * Simple test to ensure that main page loads with module enabled. * * @group islandora_text_extraction */ -class LoadTest extends BrowserTestBase { +class LoadTest extends IslandoraFunctionalTestBase { /** * Modules to enable. @@ -29,7 +29,7 @@ class LoadTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected function setUp() { + public function setUp() { parent::setUp(); $this->user = $this->drupalCreateUser(['administer site configuration']); $this->drupalLogin($this->user); diff --git a/modules/islandora_video/config/schema/islandora_video.info.yml b/modules/islandora_video/config/schema/islandora_video.schema.yml similarity index 88% rename from modules/islandora_video/config/schema/islandora_video.info.yml rename to modules/islandora_video/config/schema/islandora_video.schema.yml index 2d54e4b0..b1d72d7f 100644 --- a/modules/islandora_video/config/schema/islandora_video.info.yml +++ b/modules/islandora_video/config/schema/islandora_video.schema.yml @@ -8,6 +8,9 @@ action.configuration.generate_video_derivative: event: type: text label: 'Event Type' + destination_media_type: + type: text + label: 'Destination media type' source_term_uri: type: text label: 'Source term uri' diff --git a/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php b/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php index 02beca06..b7b5adc3 100644 --- a/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php +++ b/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php @@ -19,10 +19,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase { /** * @covers \Drupal\islandora_video\Plugin\Action\GenerateVideoDerivative::defaultConfiguration * @covers \Drupal\islandora_video\Plugin\Action\GenerateVideoDerivative::buildConfigurationForm - * @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::defaultConfiguration - * @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::buildConfigurationForm - * @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::submitConfigurationForm - * @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::execute + * @covers \Drupal\islandora_video\Plugin\Action\GenerateVideoDerivative::validateConfigurationForm */ public function testGenerateVideoDerivativeFromScratch() { @@ -46,6 +43,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase { $this->getSession()->getPage()->fillField('edit-label', "Generate video test derivative"); $this->getSession()->getPage()->fillField('edit-id', "generate_video_test_derivative"); $this->getSession()->getPage()->fillField('edit-queue', "generate-video-test-derivative"); + $this->getSession()->getPage()->fillField('edit-destination-media-type', $this->testMediaType->label()); $this->getSession()->getPage()->fillField("edit-source-term", $this->preservationMasterTerm->label()); $this->getSession()->getPage()->fillField("edit-derivative-term", $this->serviceFileTerm->label()); $this->getSession()->getPage()->fillField('edit-mimetype', "video/mp4"); diff --git a/src/Form/IslandoraSettingsForm.php b/src/Form/IslandoraSettingsForm.php index ea2fad30..88d3d1c2 100644 --- a/src/Form/IslandoraSettingsForm.php +++ b/src/Form/IslandoraSettingsForm.php @@ -104,8 +104,8 @@ class IslandoraSettingsForm extends ConfigFormBase { $form[self::FEDORA_URL] = [ '#type' => 'textfield', '#title' => $this->t('Fedora URL'), - '#attributes' => array('readonly' => 'readonly'), - '#default_value' => t($fedora_url), + '#attributes' => ['readonly' => 'readonly'], + '#default_value' => $fedora_url, ]; $selected_bundles = $config->get(self::GEMINI_PSEUDO);