Skip to content

Commit

Permalink
Adjusted tests to test values for handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
LuomaJuha committed Jan 28, 2025
1 parent 8011d10 commit 5e2292e
Show file tree
Hide file tree
Showing 5 changed files with 394 additions and 151 deletions.
95 changes: 48 additions & 47 deletions local/config/finna/ReservationList.yaml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -62,51 +62,52 @@ Institutions:
name: Service sender
email: [email protected]
subject: Reservation List
PlaceOrder:
default:
allowLocalOverride: false
title: ReservationList::form_title
enabled: true
onlyForLoggedUsers: true
emailSubject: ReservationList::form_email_subject
response: ReservationList::form_response
hideSenderInfo: true
hideRecipientInfo: true
senderNameRequired: true
includePatronId: true
help:
pre: ReservationList::request_pre_info_html
post: ReservationList::request_post_info_html
Forms:
PlaceOrder:
default:
allowLocalOverride: false
title: ReservationList::form_title
enabled: true
onlyForLoggedUsers: true
emailSubject: ReservationList::form_email_subject
response: ReservationList::form_response
hideSenderInfo: true
hideRecipientInfo: true
senderNameRequired: true
includePatronId: true
help:
pre: ReservationList::request_pre_info_html
post: ReservationList::request_post_info_html

fields:
- name: record_ids_text
type: textarea
label: ReservationList::Reservation Resources
settings:
- [rows, 3]
- [readonly, true]
- name: firstName
type: text
label: First Name
required: true
- name: lastName
type: text
label: Last Name
required: true
- name: email
type: email
label: Email
- name: phone
type: text
label: Phone
- name: pickup_date
type: date
label: ReservationList::Delivery Time Request
minValue: now + 2 days
maxValue: now + 1 year
required: true
- name: message
type: textarea
label: ReservationList::Message
settings:
- [rows, 3]
fields:
- name: record_ids_text
type: textarea
label: ReservationList::Reservation Resources
settings:
- [rows, 3]
- [readonly, true]
- name: firstName
type: text
label: First Name
required: true
- name: lastName
type: text
label: Last Name
required: true
- name: email
type: email
label: Email
- name: phone
type: text
label: Phone
- name: pickup_date
type: date
label: ReservationList::Delivery Time Request
minValue: now + 2 days
maxValue: now + 1 year
required: true
- name: message
type: textarea
label: ReservationList::Message
settings:
- [rows, 3]
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
if (!empty($options)) {
throw new \Exception('Unexpected options sent to factory.');
}
return new $requestedName($container);
$handler = new $requestedName($container);
$handler->setLogger($container->get(\VuFind\Log\Logger::class));
return $handler;
}
}
167 changes: 167 additions & 0 deletions module/Finna/tests/fixtures/reservationlist/ReservationList.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Settings for reservation lists
# To enable lists in your site, see section ReservationList in config.ini.sample
# Enabled key in the root defines if the list functionality is enabled
# Root key is the identifier of institutions controlling the lists
# Under that is general Information about institution and Lists
# Each list entry has to contain Identifier which should be unique for each list under institution.
# Recipient contains email address(es) where the reservation is to be sent
# Datasources contains record datasources which can be added to the list
# List can contain same information as under institution information to be more specific
# about where the order is being delivered
# LibraryCardSources is used to check for active connection to ILS to be able to use lists
# Connection defines how the orders are handled with institutions:
# Type:
# email: Uses email to place orders
# Sender:
# name: Name to be shown as the sender of the email
# email: Email address to be shown as where the email was sent
# Subject: Subject to be shown in the email
# disec: Uses Disec api for sending orders
# base_url: Api base url
# secret: Api specific secret
# use_cat_id: [Optional] Use catalog id for user instead of firstName, lastName, email. Default false.
#
# Each list declared uses their own translation keys under translation domain ReservationList::
#
# "list_title_{$institution}_{$identifier}"
# Generic title of the list i.e Order resources to Library Tests Research Room etc.
#
# "list_description_{$institution}_{$identifier}"
# Generic description about the list i.e These reservations will be delivered to nnn etc.
#
Institutions:
Example Institution:
Information:
name: Example Institution Name
address: Example Institution address
postal: Example Institution postal
city: Example Institution city
email: Example Institution email
Lists:
- Identifier: list_with_email
Enabled: true
Recipient:
- name: name_of_the_recipient_1
email: email_of_the_recipient_1
- name: name_of_the_recipient_2
email: email_of_the_recipient_2
Datasources:
- datasource_1
- datasource_2
Information:
Address: teststreet 10
Postal: 000001
City: Test city
Forms:
PlaceOrder: default
LibraryCardSources:
- connection_established_to_use_lists
Connection:
type: email
Sender:
name: sender_test
email: [email protected]
Subject: Reservation List
- Identifier: list_with_disec
Enabled: true
Datasources:
- datasource_1
- datasource_2
Information:
Address: teststreet 10
Postal: 000001
City: Test city
Forms:
PlaceOrder: default
LibraryCardSources:
- connection_established_to_use_lists
Connection:
type: disec
base_url: "http://disectest.url.fi/"
secret: verysecretphrase
- Identifier: list_not_enabled
Enabled: false
Datasources:
- datasource_1
- datasource_2
Information:
Address: teststreet 10
Postal: 000001
City: Test city
Forms:
PlaceOrder: default
LibraryCardSources:
- connection_established_to_use_lists
Connection:
type: disec
base_url: "http://disectest.url.fi/"
secret: verysecretphrase
- Identifier: list_insufficient_data
Enabled: false
Recipient:
- name: name_of_the_recipient_1
email: email_of_the_recipient_1
- name: name_of_the_recipient_2
email: email_of_the_recipient_2
Datasources:
- datasource_1
- datasource_2
Forms:
PlaceOrder: default
LibraryCardSources:
- connection_established_to_use_lists
Connection:
type: email
Sender:
name: Service sender
email: [email protected]
Subject: Reservation List
Forms:
PlaceOrder:
default:
allowLocalOverride: false
title: ReservationList::form_title
enabled: true
onlyForLoggedUsers: true
emailSubject: ReservationList::form_email_subject
response: ReservationList::form_response
hideSenderInfo: true
hideRecipientInfo: true
senderNameRequired: true
includePatronId: true
help:
pre: ReservationList::request_pre_info_html
post: ReservationList::request_post_info_html

fields:
- name: record_ids_text
type: textarea
label: ReservationList::Reservation Resources
settings:
- [rows, 3]
- [readonly, true]
- name: firstName
type: text
label: First Name
required: true
- name: lastName
type: text
label: Last Name
required: true
- name: email
type: email
label: Email
- name: phone
type: text
label: Phone
- name: pickup_date
type: date
label: ReservationList::Delivery Time Request
minValue: now + 2 days
maxValue: now + 1 year
required: true
- name: message
type: textarea
label: ReservationList::Message
settings:
- [rows, 3]
Empty file.
Loading

0 comments on commit 5e2292e

Please sign in to comment.