Commit f1307269 authored by bojanz's avatar bojanz
Browse files

Test cleanup.

parent 6be088eb
......@@ -12,8 +12,7 @@ final class AddressEvents {
*
* @Event
*
* @see \Drupal\address\Event\AddressFormatDefinitionEvent
* @see \CommerceGuys\Addressing\AddressFormat\AddressFormat
* @see \Drupal\address\Event\AddressFormatEvent
*/
const ADDRESS_FORMAT = 'address.address_format';
......
......@@ -434,7 +434,7 @@ class AddressDefaultWidgetTest extends WebTestBase {
* variables in the message text, not t(). If left blank, a default message
* will be displayed.
*/
protected function assertOptions($id, $options, $message) {
protected function assertOptions($id, $options, $message = '') {
$elements = $this->xpath('//select[@name="' . $id . '"]/option/@value');
$found_options = [];
foreach ($elements as $key => $element) {
......
name: Module for testing address events
name: Address test
type: module
description: 'Provides functionality for testing the events in address module.'
package: Testing
......
......@@ -19,12 +19,12 @@ class AddressTestEventSubscriber implements EventSubscriberInterface {
}
/**
* Generate a set of available countries.
* Generates a set of available countries.
*
* @return array Array of countries.
* @return array The countries.
*/
public function getAvailableCountries() {
return ['AU' => 'AU', 'BR' => 'BR', 'CA' => 'CA', 'FR' => 'FR', 'JP' => 'JP'];
return ['AU' => 'AU', 'BR' => 'BR', 'CA' => 'CA', 'GB' => 'GB', 'JP' => 'JP'];
}
/**
......@@ -49,18 +49,20 @@ class AddressTestEventSubscriber implements EventSubscriberInterface {
}
/**
* Set available countries in the available countries event.
* Alters the available countries.
*
* @param \Drupal\address\Event\AvailableCountriesEvent $event
* The available countries event.
*/
public function onAvailableCountries(AvailableCountriesEvent $event) {
$event->setAvailableCountries($this->getAvailableCountries());
}
/**
* Set initial values in the initial values event.
* Alters the initial values.
*
* @param \Drupal\address\Event\InitialValuesEvent $event
* The initial values event.
*/
public function onInitialValues(InitialValuesEvent $event) {
$event->setInitialValues($this->getInitialValues());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment