diff --git a/modules/cloud_service_providers/aws_cloud/aws_cloud.info.yml b/modules/cloud_service_providers/aws_cloud/aws_cloud.info.yml index fa4c25f8..5b37049e 100644 --- a/modules/cloud_service_providers/aws_cloud/aws_cloud.info.yml +++ b/modules/cloud_service_providers/aws_cloud/aws_cloud.info.yml @@ -6,6 +6,7 @@ dependencies: - drupal:options - drupal:user - cloud:cloud + - drupal:system (>=8.7.0) # core: 8.x # version: 8.x-1.x # project: cloud diff --git a/modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/AwsCloudServerTemplateListBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/AwsCloudServerTemplateListBuilder.php index 6ad1e73b..6a3709e6 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/AwsCloudServerTemplateListBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Controller/Ec2/AwsCloudServerTemplateListBuilder.php @@ -79,32 +79,32 @@ class AwsCloudServerTemplateListBuilder extends CloudServerTemplateListBuilder { // to know what database column to sort by. $parent_header[0], [ - 'data' => t('AMI Name'), + 'data' => $this->t('AMI Name'), 'specifier' => 'field_image_id', 'field' => 'field_image_id', ], [ - 'data' => t('Instance Type'), + 'data' => $this->t('Instance Type'), 'specifier' => 'field_instance_type', 'field' => 'field_instance_type', ], [ - 'data' => t('Security Group'), + 'data' => $this->t('Security Group'), 'specifier' => 'field_security_group', 'field' => 'field_security_group', ], [ - 'data' => t('Key Pair'), + 'data' => $this->t('Key Pair'), 'specifier' => 'field_ssh_key', 'field' => 'field_ssh_key', ], [ - 'data' => t('VPC'), + 'data' => $this->t('VPC'), 'specifier' => 'field_vpc', 'field' => 'field_vpc', ], [ - 'data' => t('Max Count'), + 'data' => $this->t('Max Count'), 'specifier' => 'field_max_count', 'field' => 'field_max_count', ], diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/AwsCloudViewsData.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/AwsCloudViewsData.php index 55b6fa46..cc44102a 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/AwsCloudViewsData.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/AwsCloudViewsData.php @@ -27,10 +27,10 @@ class AwsCloudViewsData extends EntityViewsData implements EntityViewsDataInterf /* @var \Drupal\Core\Field\BaseFieldDefinition $field */ if (in_array($key, $selectable)) { $data[$table_name][$key . '_fs'] = [ - 'title' => t('@label (selector)', [ + 'title' => $this->t('@label (selector)', [ '@label' => $field->getLabel(), ]), - 'help' => t('Provides a dropdown option for text filtering. If there are no results, the filter will not be shown.'), + 'help' => $this->t('Provides a dropdown option for text filtering. If there are no results, the filter will not be shown.'), 'filter' => [ 'field' => $key, 'table' => $table_name, diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ElasticIpViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ElasticIpViewBuilder.php index eaf5713f..b2f1b7ba 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ElasticIpViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ElasticIpViewBuilder.php @@ -14,7 +14,7 @@ class ElasticIpViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'ip_address', - 'title' => t('IP Address'), + 'title' => $this->t('IP Address'), 'open' => TRUE, 'fields' => [ 'public_ip', @@ -24,7 +24,7 @@ class ElasticIpViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'assign', - 'title' => t('Assign'), + 'title' => $this->t('Assign'), 'open' => TRUE, 'fields' => [ 'instance_id', @@ -37,7 +37,7 @@ class ElasticIpViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewBuilder.php index b1f111cb..6d3b8421 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewBuilder.php @@ -14,7 +14,7 @@ class ImageViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'image', - 'title' => t('Image'), + 'title' => $this->t('Image'), 'open' => TRUE, 'fields' => [ 'name', @@ -31,7 +31,7 @@ class ImageViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'type', - 'title' => t('Type'), + 'title' => $this->t('Type'), 'open' => TRUE, 'fields' => [ 'platform', @@ -43,7 +43,7 @@ class ImageViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'device', - 'title' => t('Device'), + 'title' => $this->t('Device'), 'open' => TRUE, 'fields' => [ 'root_device_name', @@ -55,7 +55,7 @@ class ImageViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewsData.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewsData.php index cc5a256f..a2b70e5b 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewsData.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/ImageViewsData.php @@ -40,8 +40,8 @@ class ImageViewsData extends AwsCloudViewsData { $data['aws_cloud_image']['table']['base'] = [ 'field' => 'id', - 'title' => t('AWS Cloud Image'), - 'help' => t('The AWS Cloud Image entity ID.'), + 'title' => $this->t('AWS Cloud Image'), + 'help' => $this->t('The AWS Cloud Image entity ID.'), ]; $data['aws_cloud_image']['table']['base']['access query tag'] = 'aws_cloud_image_views_access'; diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/InstanceViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/InstanceViewBuilder.php index ee7c38f7..1515c0c8 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/InstanceViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/InstanceViewBuilder.php @@ -16,7 +16,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'instance', - 'title' => t('Instance'), + 'title' => $this->t('Instance'), 'open' => TRUE, 'fields' => [ 'instance_id', @@ -37,7 +37,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'network', - 'title' => t('Network'), + 'title' => $this->t('Network'), 'open' => TRUE, 'fields' => [ 'network_interfaces', @@ -53,7 +53,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'storage', - 'title' => t('Storage'), + 'title' => $this->t('Storage'), 'open' => TRUE, 'fields' => [ 'root_device_type', @@ -63,7 +63,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'fieldset_tags', - 'title' => t('Tags'), + 'title' => $this->t('Tags'), 'open' => TRUE, 'fields' => [ 'tags', @@ -71,7 +71,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'options', - 'title' => t('Options'), + 'title' => $this->t('Options'), 'open' => TRUE, 'fields' => [ 'termination_protection', @@ -85,7 +85,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/KeyPairViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/KeyPairViewBuilder.php index 80ce615c..215bbd40 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/KeyPairViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/KeyPairViewBuilder.php @@ -14,7 +14,7 @@ class KeyPairViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'key_pair', - 'title' => t('Key Pair'), + 'title' => $this->t('Key Pair'), 'open' => TRUE, 'fields' => [ 'key_pair_name', @@ -25,7 +25,7 @@ class KeyPairViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/NetworkInterfaceViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/NetworkInterfaceViewBuilder.php index 623e4ef7..554a3aaf 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/NetworkInterfaceViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/NetworkInterfaceViewBuilder.php @@ -14,7 +14,7 @@ class NetworkInterfaceViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'network_interface', - 'title' => t('Network Interface'), + 'title' => $this->t('Network Interface'), 'open' => TRUE, 'fields' => [ 'description', @@ -30,7 +30,7 @@ class NetworkInterfaceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'network', - 'title' => t('Network'), + 'title' => $this->t('Network'), 'open' => TRUE, 'fields' => [ 'security_groups', @@ -44,7 +44,7 @@ class NetworkInterfaceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'attachment', - 'title' => t('Attachment'), + 'title' => $this->t('Attachment'), 'open' => FALSE, 'fields' => [ 'attachment_id', @@ -54,13 +54,13 @@ class NetworkInterfaceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'owner', - 'title' => t('Owner'), + 'title' => $this->t('Owner'), 'open' => FALSE, 'fields' => ['account_id'], ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewBuilder.php index d11b2fcf..2acc3957 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewBuilder.php @@ -16,7 +16,7 @@ class SecurityGroupViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'security_group', - 'title' => t('Security Group'), + 'title' => $this->t('Security Group'), 'open' => TRUE, 'fields' => [ 'group_id', @@ -28,7 +28,7 @@ class SecurityGroupViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'rules', - 'title' => t('Rules'), + 'title' => $this->t('Rules'), 'open' => FALSE, 'fields' => [ 'ip_permission', @@ -37,7 +37,7 @@ class SecurityGroupViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewsData.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewsData.php index c1d36903..37073157 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewsData.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SecurityGroupViewsData.php @@ -30,8 +30,8 @@ class SecurityGroupViewsData extends AwsCloudViewsData { $data['$table_name']['table']['base'] = [ 'field' => 'id', - 'title' => t('AWS Security Group'), - 'help' => t('The AWS Security Group entity'), + 'title' => $this->t('AWS Security Group'), + 'help' => $this->t('The AWS Security Group entity'), ]; $this->addDropdownSelector($data, $table_name, $fields, $selectable); diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewBuilder.php index 51bc8f0f..a9ef623d 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewBuilder.php @@ -14,7 +14,7 @@ class SnapshotViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'snapshot', - 'title' => t('Snapshot'), + 'title' => $this->t('Snapshot'), 'open' => TRUE, 'fields' => [ 'description', @@ -29,7 +29,7 @@ class SnapshotViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewsData.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewsData.php index cb5d892d..c64ff158 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewsData.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/SnapshotViewsData.php @@ -15,8 +15,8 @@ class SnapshotViewsData extends AwsCloudViewsData { $data['aws_cloud_snapshot']['table']['base'] = [ 'field' => 'id', - 'title' => t('AWS Cloud Snapshot'), - 'help' => t('The AWC Cloud Snapshot entity ID.'), + 'title' => $this->t('AWS Cloud Snapshot'), + 'help' => $this->t('The AWC Cloud Snapshot entity ID.'), ]; $data['aws_cloud_snapshot']['snapshot_bulk_form'] = [ diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/VolumeViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/VolumeViewBuilder.php index d50450b6..c0d2dc28 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/VolumeViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Ec2/VolumeViewBuilder.php @@ -14,7 +14,7 @@ class VolumeViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'volume', - 'title' => t('Volume'), + 'title' => $this->t('Volume'), 'open' => TRUE, 'fields' => [ 'attachment_information', @@ -32,7 +32,7 @@ class VolumeViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewBuilder.php index 94402b1f..3afc759b 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewBuilder.php @@ -16,7 +16,7 @@ class SubnetViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'subnet', - 'title' => t('Subnet'), + 'title' => $this->t('Subnet'), 'open' => TRUE, 'fields' => [ 'subnet_id', @@ -28,7 +28,7 @@ class SubnetViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'fieldset_tags', - 'title' => t('Tags'), + 'title' => $this->t('Tags'), 'open' => TRUE, 'fields' => [ 'tags', @@ -36,7 +36,7 @@ class SubnetViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewsData.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewsData.php index 4414f96d..82ebf9c9 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewsData.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/SubnetViewsData.php @@ -17,8 +17,8 @@ class SubnetViewsData extends AwsCloudViewsData { $data['aws_cloud_subnet']['table']['base'] = [ 'field' => 'id', - 'title' => t('AWS Cloud Subnet'), - 'help' => t('The AWC Cloud Subnet entity ID.'), + 'title' => $this->t('AWS Cloud Subnet'), + 'help' => $this->t('The AWC Cloud Subnet entity ID.'), ]; $data['aws_cloud_subnet']['subnet_bulk_form'] = [ diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewBuilder.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewBuilder.php index 1952ffc1..63ede0ed 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewBuilder.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewBuilder.php @@ -16,7 +16,7 @@ class VpcViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'vpc', - 'title' => t('VPC'), + 'title' => $this->t('VPC'), 'open' => TRUE, 'fields' => [ 'vpc_id', @@ -30,7 +30,7 @@ class VpcViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'fieldset_cidr_blocks', - 'title' => t('CIDR Blocks'), + 'title' => $this->t('CIDR Blocks'), 'open' => TRUE, 'fields' => [ 'cidr_blocks', @@ -38,7 +38,7 @@ class VpcViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'fieldset_ipv6_cidr_blocks', - 'title' => t('IPv6 CIDR Blocks'), + 'title' => $this->t('IPv6 CIDR Blocks'), 'open' => TRUE, 'fields' => [ 'ipv6_cidr_blocks', @@ -46,7 +46,7 @@ class VpcViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'fieldset_tags', - 'title' => t('Tags'), + 'title' => $this->t('Tags'), 'open' => TRUE, 'fields' => [ 'tags', @@ -54,7 +54,7 @@ class VpcViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewsData.php b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewsData.php index a346f4a6..beeb45bd 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewsData.php +++ b/modules/cloud_service_providers/aws_cloud/src/Entity/Vpc/VpcViewsData.php @@ -17,8 +17,8 @@ class VpcViewsData extends AwsCloudViewsData { $data['aws_cloud_vpc']['table']['base'] = [ 'field' => 'id', - 'title' => t('AWS Cloud VPC'), - 'help' => t('The AWC Cloud VPC entity ID.'), + 'title' => $this->t('AWS Cloud VPC'), + 'help' => $this->t('The AWC Cloud VPC entity ID.'), ]; $data['aws_cloud_vpc']['vpc_bulk_form'] = [ diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/ElasticIpAssociateForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/ElasticIpAssociateForm.php index 773c4ca8..fd0d4690 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/ElasticIpAssociateForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/ElasticIpAssociateForm.php @@ -33,7 +33,7 @@ class ElasticIpAssociateForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Associate'); + return $this->t('Associate'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceAssociateElasticIpForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceAssociateElasticIpForm.php index 47ccaf40..600f5082 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceAssociateElasticIpForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceAssociateElasticIpForm.php @@ -36,7 +36,7 @@ class InstanceAssociateElasticIpForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Associate'); + return $this->t('Associate'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceCreateImageForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceCreateImageForm.php index 2d350450..9078352f 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceCreateImageForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceCreateImageForm.php @@ -25,7 +25,7 @@ class InstanceCreateImageForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Create Image'); + return $this->t('Create Image'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceDeleteForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceDeleteForm.php index 2dd45e83..bc2c3bf0 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceDeleteForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceDeleteForm.php @@ -16,7 +16,7 @@ class InstanceDeleteForm extends AwsDeleteForm { */ public function getConfirmText() { - return t('Delete | Terminate'); + return $this->t('Delete | Terminate'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceEditForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceEditForm.php index 4a6abe36..ed05ccba 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceEditForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceEditForm.php @@ -339,9 +339,9 @@ class InstanceEditForm extends AwsCloudContentForm { ]; $form['options']['termination_protection'] = [ - '#title' => t('Termination Protection'), + '#title' => $this->t('Termination Protection'), '#type' => 'checkbox', - '#description' => t('Indicates whether termination protection is enabled. If enabled, this instance cannot be terminated using the console, API, or CLI until termination protection is disabled.'), + '#description' => $this->t('Indicates whether termination protection is enabled. If enabled, this instance cannot be terminated using the console, API, or CLI until termination protection is disabled.'), '#default_value' => $entity->getTerminationProtection(), ]; @@ -378,11 +378,11 @@ class InstanceEditForm extends AwsCloudContentForm { $schedule = $entity->getSchedule(); $form['options']['schedule'] = [ - '#title' => t('Schedule'), + '#title' => $this->t('Schedule'), '#type' => 'select', '#default_value' => isset($schedule) ? $entity->getSchedule() : '', '#options' => aws_cloud_get_schedule(), - '#description' => t('Specify a start/stop schedule. This helps reduce server hosting costs.'), + '#description' => $this->t('Specify a start/stop schedule. This helps reduce server hosting costs.'), ]; $form['options']['login_username'] = [ @@ -445,8 +445,8 @@ class InstanceEditForm extends AwsCloudContentForm { if ($termination_timestamp != NULL && $termination_protection == 1) { $form_state->setErrorByName( 'termination_timestamp', - t('"@name1" should be left blank if "@name2" is selected. Please leave "@name1" blank or unselect "@name2".', - ['@name1' => t('Termination Date'), '@name2' => t('Termination Protection')] + $this->t('"@name1" should be left blank if "@name2" is selected. Please leave "@name1" blank or unselect "@name2".', + ['@name1' => $this->t('Termination Date'), '@name2' => $this->t('Termination Protection')] ) ); } diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceLaunchForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceLaunchForm.php index bb355cbe..27c32ce8 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceLaunchForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceLaunchForm.php @@ -112,7 +112,7 @@ class InstanceLaunchForm extends AwsCloudContentForm { $form['is_monitoring'] = [ '#type' => 'select', '#title' => $this->t('Monitoring Enabled'), - '#options' => [0 => t('No'), 1 => t('Yes')], + '#options' => [0 => $this->t('No'), 1 => $this->t('Yes')], '#default_value' => 0, '#weight' => -5, '#required' => TRUE, diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceRebootForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceRebootForm.php index d24667aa..816686b7 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceRebootForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceRebootForm.php @@ -15,7 +15,7 @@ class InstanceRebootForm extends AwsDeleteForm { public function getQuestion() { $entity = $this->entity; - return t('Are you sure you want to reboot instance: %name?', [ + return $this->t('Are you sure you want to reboot instance: %name?', [ '%name' => $entity->label(), ]); } @@ -24,7 +24,7 @@ class InstanceRebootForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Reboot'); + return $this->t('Reboot'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStartForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStartForm.php index b4ccfb2a..8a444eee 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStartForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStartForm.php @@ -18,7 +18,7 @@ class InstanceStartForm extends AwsDeleteForm { public function getQuestion() { $entity = $this->entity; - return t('Are you sure you want to start instance: %name?', [ + return $this->t('Are you sure you want to start instance: %name?', [ '%name' => $entity->label(), ]); } @@ -27,7 +27,7 @@ class InstanceStartForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Start'); + return $this->t('Start'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStopForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStopForm.php index 88648e98..15200995 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStopForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceStopForm.php @@ -21,7 +21,7 @@ class InstanceStopForm extends AwsDeleteForm { public function getQuestion() { $entity = $this->entity; - return t('Are you sure you want to stop instance: %name?', [ + return $this->t('Are you sure you want to stop instance: %name?', [ '%name' => $entity->label(), ]); } @@ -30,7 +30,7 @@ class InstanceStopForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Stop'); + return $this->t('Stop'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/KeyPairImportForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/KeyPairImportForm.php index 7cd79f0f..ac1fdcc9 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/KeyPairImportForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/KeyPairImportForm.php @@ -46,12 +46,12 @@ class KeyPairImportForm extends AwsCloudContentForm { $form['key_pair']['key_pair_public_key'] = [ '#type' => 'file', '#title' => 'Public Key', - '#description' => t('Upload your public key'), + '#description' => $this->t('Upload your public key'), '#weight' => -4, ]; $form['langcode'] = [ - '#title' => t('Language'), + '#title' => $this->t('Language'), '#type' => 'language_select', '#default_value' => $entity->getUntranslated()->language()->getId(), '#languages' => Language::STATE_ALL, diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/SecurityGroupRevokeForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/SecurityGroupRevokeForm.php index 13449fa2..7b471df1 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/SecurityGroupRevokeForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/SecurityGroupRevokeForm.php @@ -16,7 +16,7 @@ class SecurityGroupRevokeForm extends AwsDeleteForm { */ public function getQuestion() { $type = $this->getRequest()->query->get('type'); - return t('Are you sure you want to revoke the following @type permission?', + return $this->t('Are you sure you want to revoke the following @type permission?', [ '@type' => $type == 'outbound_permission' ? 'outbound' : 'inbound', ] @@ -27,7 +27,7 @@ class SecurityGroupRevokeForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Revoke'); + return $this->t('Revoke'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/VolumeAttachForm.php b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/VolumeAttachForm.php index 2e548bd6..93ae3d9f 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/VolumeAttachForm.php +++ b/modules/cloud_service_providers/aws_cloud/src/Form/Ec2/VolumeAttachForm.php @@ -24,7 +24,7 @@ class VolumeAttachForm extends AwsDeleteForm { * {@inheritdoc} */ public function getConfirmText() { - return t('Attach'); + return $this->t('Attach'); } /** diff --git a/modules/cloud_service_providers/aws_cloud/src/Plugin/Block/ResourcesBlock.php b/modules/cloud_service_providers/aws_cloud/src/Plugin/Block/ResourcesBlock.php index 3aa64ceb..5ccf87e2 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Plugin/Block/ResourcesBlock.php +++ b/modules/cloud_service_providers/aws_cloud/src/Plugin/Block/ResourcesBlock.php @@ -111,8 +111,8 @@ class ResourcesBlock extends BlockBase implements ContainerFactoryPluginInterfac $config = $this->getConfiguration(); $form['cloud_context'] = [ '#type' => 'select', - '#title' => t('Cloud Service Provider'), - '#description' => t('Select cloud service provider'), + '#title' => $this->t('Cloud Service Provider'), + '#description' => $this->t('Select cloud service provider'), '#options' => $this->getCloudConfigs(), '#default_value' => isset($config['cloud_context']) ? $config['cloud_context'] : '', ]; diff --git a/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/CidrBlock.php b/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/CidrBlock.php index 2ede4bcb..beed07b1 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/CidrBlock.php +++ b/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/CidrBlock.php @@ -93,10 +93,10 @@ class CidrBlock extends FieldItemBase { $elements['max_length'] = [ '#type' => 'number', - '#title' => t('Maximum length'), + '#title' => $this->t('Maximum length'), '#default_value' => $this->getSetting('max_length'), '#required' => TRUE, - '#description' => t('The maximum length of the field in characters.'), + '#description' => $this->t('The maximum length of the field in characters.'), '#min' => 1, '#disabled' => $has_data, ]; diff --git a/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/IpPermission.php b/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/IpPermission.php index 2809dfce..4feb6212 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/IpPermission.php +++ b/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/IpPermission.php @@ -195,10 +195,10 @@ class IpPermission extends FieldItemBase { $elements['max_length'] = [ '#type' => 'number', - '#title' => t('Maximum length'), + '#title' => $this->t('Maximum length'), '#default_value' => $this->getSetting('max_length'), '#required' => TRUE, - '#description' => t('The maximum length of the field in characters.'), + '#description' => $this->t('The maximum length of the field in characters.'), '#min' => 1, '#disabled' => $has_data, ]; diff --git a/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/Tag.php b/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/Tag.php index 4ce84066..b6cf6a30 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/Tag.php +++ b/modules/cloud_service_providers/aws_cloud/src/Plugin/Field/FieldType/Tag.php @@ -75,10 +75,10 @@ class Tag extends FieldItemBase { $elements['max_length'] = [ '#type' => 'number', - '#title' => t('Maximum length'), + '#title' => $this->t('Maximum length'), '#default_value' => $this->getSetting('max_length'), '#required' => TRUE, - '#description' => t('The maximum length of the field in characters.'), + '#description' => $this->t('The maximum length of the field in characters.'), '#min' => 1, '#disabled' => $has_data, ]; diff --git a/modules/cloud_service_providers/aws_cloud/src/Plugin/cloud/server_template/AwsCloudServerTemplatePlugin.php b/modules/cloud_service_providers/aws_cloud/src/Plugin/cloud/server_template/AwsCloudServerTemplatePlugin.php index 380783dc..d08658f2 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Plugin/cloud/server_template/AwsCloudServerTemplatePlugin.php +++ b/modules/cloud_service_providers/aws_cloud/src/Plugin/cloud/server_template/AwsCloudServerTemplatePlugin.php @@ -333,32 +333,32 @@ class AwsCloudServerTemplatePlugin extends PluginBase implements CloudServerTemp public function buildListHeader() { return [ [ - 'data' => t('AMI Name'), + 'data' => $this->t('AMI Name'), 'specifier' => 'field_image_id', 'field' => 'field_image_id', ], [ - 'data' => t('Instance Type'), + 'data' => $this->t('Instance Type'), 'specifier' => 'field_instance_type', 'field' => 'field_instance_type', ], [ - 'data' => t('Security Group'), + 'data' => $this->t('Security Group'), 'specifier' => 'field_security_group', 'field' => 'field_security_group', ], [ - 'data' => t('Key Pair'), + 'data' => $this->t('Key Pair'), 'specifier' => 'field_ssh_key', 'field' => 'field_ssh_key', ], [ - 'data' => t('VPC'), + 'data' => $this->t('VPC'), 'specifier' => 'field_vpc', 'field' => 'field_vpc', ], [ - 'data' => t('Max Count'), + 'data' => $this->t('Max Count'), 'specifier' => 'field_max_count', 'field' => 'field_max_count', ], diff --git a/modules/cloud_service_providers/aws_cloud/src/Plugin/views/filter/TextToSelectFilter.php b/modules/cloud_service_providers/aws_cloud/src/Plugin/views/filter/TextToSelectFilter.php index 25315722..d5cb7b68 100644 --- a/modules/cloud_service_providers/aws_cloud/src/Plugin/views/filter/TextToSelectFilter.php +++ b/modules/cloud_service_providers/aws_cloud/src/Plugin/views/filter/TextToSelectFilter.php @@ -47,8 +47,8 @@ class TextToSelectFilter extends InOperator implements ContainerFactoryPluginInt parent::buildExposeForm($form, $form_state); $form['expose']['sort_values'] = [ '#type' => 'radios', - '#title' => t('Value order'), - '#description' => t('How to sort the values in the exposed form'), + '#title' => $this->t('Value order'), + '#description' => $this->t('How to sort the values in the exposed form'), '#options' => [0 => $this->t('ASC'), 1 => $this->t('DESC')], '#default_value' => $this->options['expose']['sort_values'], '#weight' => 1, diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/AwsCloudTestCase.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/AwsCloudTestCase.php index 44253c9d..a72cf05a 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/AwsCloudTestCase.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/AwsCloudTestCase.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\aws_cloud\Functional; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Component\Serialization\Yaml; use Drupal\Component\Utility\Random; use Drupal\Tests\aws_cloud\Traits\AwsCloudTestEntityTrait; @@ -16,6 +17,7 @@ use Drupal\aws_cloud\Service\Pricing\GoogleSpreadsheetService; */ abstract class AwsCloudTestCase extends BrowserTestBase { + use StringTranslationTrait; use AwsCloudTestEntityTrait; use AwsCloudTestFormDataTrait; use AwsCloudTestMockTrait; diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Config/AwsCloudConfigTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Config/AwsCloudConfigTest.php index f3f960fa..75606035 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Config/AwsCloudConfigTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Config/AwsCloudConfigTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\aws_cloud\Functional\Config; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Tests\BrowserTestBase; use Drupal\Component\Utility\Random; use Drupal\Tests\aws_cloud\Traits\AwsCloudTestEntityTrait; @@ -16,6 +17,7 @@ use Drupal\Tests\aws_cloud\Traits\AwsCloudTestFormDataTrait; */ class AwsCloudConfigTest extends BrowserTestBase { + use StringTranslationTrait; use AwsCloudTestEntityTrait; use AwsCloudTestFormDataTrait; @@ -92,9 +94,9 @@ class AwsCloudConfigTest extends BrowserTestBase { // List AWS Cloud for Amazon EC2. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Add a new Config information. $add = $this->createCloudConfigTestFormData(); @@ -123,46 +125,46 @@ class AwsCloudConfigTest extends BrowserTestBase { unset($add[$i]['field_image_upload_url']); $this->drupalGet('/admin/structure/cloud_config/add'); - $this->assertResponse(200, t('HTTP 200: Add | AWS Cloud cloud service provider (CloudConfig) form')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Add | AWS Cloud cloud service provider (CloudConfig) form')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->drupalPostForm('/admin/structure/cloud_config/add', $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('HTTP 200: Saved | AWS cloud service provider form')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); - $this->assertText(t('Creating cloud service provider was performed successfully.'), t('Create cloud service provider')); + $this->assertResponse(200, $this->t('HTTP 200: Saved | AWS cloud service provider form')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); + $this->assertText($this->t('Creating cloud service provider was performed successfully.'), $this->t('Create cloud service provider')); foreach ($labels as $label) { - $this->assertText($label, t('The cloud service provider (CloudConfig) name: @label', ['@label' => $label])); + $this->assertText($label, $this->t('The cloud service provider (CloudConfig) name: @label', ['@label' => $label])); } // Make sure listing for '/admin/structure/cloud_config'. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); foreach ($labels as $label) { $this->assertLink($label); } // Make sure listing for '/clouds'. $this->drupalGet('/clouds'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); foreach ($labels as $label) { $this->assertLink($label); } // Make sure listing for '/admin/config/services/cloud/aws_cloud'. $this->drupalGet('/admin/config/services/cloud/aws_cloud'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); foreach ($labels as $label) { $this->assertLink($label); } @@ -185,36 +187,36 @@ class AwsCloudConfigTest extends BrowserTestBase { $this->drupalPostForm("/admin/structure/cloud_config/${num}/edit", $edit[$i], - t('Save')); - $this->assertResponse(200, t('HTTP 200: Edit | AWS Cloud Form')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Save')); + $this->assertResponse(200, $this->t('HTTP 200: Edit | AWS Cloud Form')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); - $this->assertText($label, t('The cloud service provider (CloudConfig) name: @label', ['@label' => $label])); + $this->assertText($label, $this->t('The cloud service provider (CloudConfig) name: @label', ['@label' => $label])); // Make sure listing for '/admin/structure/cloud_config'. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); foreach ($labels as $label) { $this->assertLink($label); } // Make sure listing for '/clouds'. $this->drupalGet('/clouds'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); foreach ($labels as $label) { $this->assertLink($label); } // Make sure listing for '/admin/config/services/cloud/aws_cloud'. $this->drupalGet('/admin/config/services/cloud/aws_cloud'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); foreach ($labels as $label) { $this->assertLink($label); } @@ -231,13 +233,13 @@ class AwsCloudConfigTest extends BrowserTestBase { $this->drupalGet("/admin/structure/cloud_config/${num}/delete"); $this->drupalPostForm("/admin/structure/cloud_config/${num}/delete", [], - t('Delete')); - $this->assertResponse(200, t('HTTP 200: Delete | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); - $this->assertText(t('The cloud service provider @label has been deleted.', ['@label' => $labels[$j]]), - t('Deleted Message:') . ' ' - . t('The cloud service provider @label has been deleted.', ['@label' => $labels[$j]])); + $this->t('Delete')); + $this->assertResponse(200, $this->t('HTTP 200: Delete | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); + $this->assertText($this->t('The cloud service provider @label has been deleted.', ['@label' => $labels[$j]]), + $this->t('Deleted Message:') . ' ' + . $this->t('The cloud service provider @label has been deleted.', ['@label' => $labels[$j]])); // Because $cloud_context has been deleted. // Make sure listing. @@ -245,25 +247,25 @@ class AwsCloudConfigTest extends BrowserTestBase { // Make sure listing for '/admin/structure/cloud_config'. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertNoLink($labels[$k], - t('The cloud service provider (CloudConfig) name @num: @label', ['@label' => $labels[$k]]) + $this->t('The cloud service provider (CloudConfig) name @num: @label', ['@label' => $labels[$k]]) ); // Make sure listing for '/clouds'. $this->drupalGet('/clouds'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertNoLink($labels[$k]); // Make sure listing for '/admin/config/services/cloud/aws_cloud'. $this->drupalGet('/admin/config/services/cloud/aws_cloud'); - $this->assertResponse(200, t('HTTP 200: List | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertNoLink($labels[$k]); } } @@ -334,14 +336,14 @@ class AwsCloudConfigTest extends BrowserTestBase { foreach ($paths as $path) { for ($i = 0; $i < $max_count; $i++) { $this->drupalGet($path); - $this->assertResponse(200, t('HTTP 200: clouds | AWS Cloud')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: clouds | AWS Cloud')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); - $this->assertText(t('Add cloud service provider'), t('Add cloud service provider')); + $this->assertText($this->t('Add cloud service provider'), $this->t('Add cloud service provider')); $this->assertText( - t('There is no cloud service provider. Please create a new one.'), - t('Guid message') + $this->t('There is no cloud service provider. Please create a new one.'), + $this->t('Guid message') ); } } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/CloudServerTemplateTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/CloudServerTemplateTest.php index 0aa148b5..9a8881c1 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/CloudServerTemplateTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/CloudServerTemplateTest.php @@ -58,19 +58,19 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); $this->createSecurityGroupTestEntity(0, '', '', '', $this->cloudContext); $this->createKeyPairTestEntity(0, '', '', $this->cloudContext); // List cloud server template for AWS. $this->drupalGet("/clouds/design/server_template/$cloud_context"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $vpcs = $this->createVpcsRandomTestFormData(); $subnets = $this->createSubnetsRandomTestFormData(); @@ -101,15 +101,15 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/design/server_template/$cloud_context/aws_cloud/add", $add[$i], - t('Save')); - $this->assertResponse(200, t('HTTP 200: Add | The new cloud server template Form #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Save')); + $this->assertResponse(200, $this->t('HTTP 200: Add | The new cloud server template Form #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Created the @name cloud server template', [ + $this->t('Created the @name cloud server template', [ '@name' => $add[$i]['name[0][value]'], ]), - t('Confirm Message: Created the @name cloud server template', [ + $this->t('Confirm Message: Created the @name cloud server template', [ '@name' => $add[$i]['name[0][value]'], ]) ); @@ -122,12 +122,12 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/design/server_template/$cloud_context"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($add[$j]['name[0][value]'], - t("Make sure w/ Listing @num: @name", [ + $this->t("Make sure w/ Listing @num: @name", [ '@num' => $j + 1, '@name' => $add[$j]['name[0][value]'], ])); @@ -154,17 +154,17 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/edit", $edit[$i], - t('Save')); - $this->assertResponse(200, t('HTTP 200: Edit | The new cloud server template #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Save')); + $this->assertResponse(200, $this->t('HTTP 200: Edit | The new cloud server template #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Saved the @name cloud server template.', + $this->t('Saved the @name cloud server template.', [ '@name' => $edit[$i]['name[0][value]'], ] ), - t('Confirm Message: Saved the @name cloud server template.', + $this->t('Confirm Message: Saved the @name cloud server template.', [ '@name' => $edit[$i]['name[0][value]'], ] @@ -176,12 +176,12 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/design/server_template/$cloud_context"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($edit[$j]['name[0][value]'], - t("Make sure w/ Listing @num: @name", [ + $this->t("Make sure w/ Listing @num: @name", [ '@num' => $j + 1, '@name' => $edit[$j]['name[0][value]'], ])); @@ -197,19 +197,19 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $this->drupalGet("/clouds/design/server_template/$cloud_context/$num/delete"); $this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/delete", [], - t('Delete')); - $this->assertResponse(200, t('HTTP 200: Delete | Cloud server template #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Make sure w/o Warnings')); + $this->t('Delete')); + $this->assertResponse(200, $this->t('HTTP 200: Delete | Cloud server template #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Make sure w/o Warnings')); // Make sure listing. $this->drupalGet("/clouds/design/server_template/$cloud_context"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server te#@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server te#@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertNoText($edit[$j]['name[0][value]'], - t("Make sure w/ Listing @num: @name", [ + $this->t("Make sure w/ Listing @num: @name", [ '@num' => $j + 1, '@name' => $edit[$j]['name[0][value]'], ])); @@ -228,10 +228,10 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); $this->createSecurityGroupTestEntity(0, '', '', '', $cloud_context); $this->createKeyPairTestEntity(0, '', '', $cloud_context); @@ -257,17 +257,17 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/design/server_template/$cloud_context/aws_cloud/add", $add[0], - t('Save')); - $this->assertResponse(200, t('HTTP 200: Add | The new CloudServerTemplate Form #@num', ['@num' => 1])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Save')); + $this->assertResponse(200, $this->t('HTTP 200: Add | The new CloudServerTemplate Form #@num', ['@num' => 1])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Created the @name cloud server template', + $this->t('Created the @name cloud server template', [ '@name' => $add[0]['name[0][value]'], ] ), - t('Confirm Message: Created the @name cloud server template', + $this->t('Confirm Message: Created the @name cloud server template', [ '@name' => $add[0]['name[0][value]'], ] @@ -276,9 +276,9 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Make sure listing revisions. $this->drupalGet("/clouds/design/server_template/$cloud_context/1/revisions"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template Revision')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template Revision')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Create a new revision. $edit = $add[0]; @@ -287,14 +287,14 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $edit['field_description[0][value]'] = $revision_desc; $this->drupalPostForm("/clouds/design/server_template/$cloud_context/1/edit", $edit, - t('Save')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Save')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Saved the @name cloud server template.', [ + $this->t('Saved the @name cloud server template.', [ '@name' => $edit['name[0][value]'], ]), - t('Confirm Message: Saved the @name cloud server template.', + $this->t('Confirm Message: Saved the @name cloud server template.', [ '@name' => $edit['name[0][value]'], ]) @@ -302,30 +302,30 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Make sure listing revisions. $this->drupalGet("/clouds/design/server_template/$cloud_context/1/revisions"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template revision')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template revision')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertSession()->linkByHrefExists("server_template/$cloud_context/1/revisions/1/view"); $this->assertSession()->linkByHrefExists("server_template/$cloud_context/1/revisions/1/revert"); $this->assertSession()->linkByHrefExists("server_template/$cloud_context/1/revisions/1/delete"); // View the revision. $this->drupalGet("/clouds/design/server_template/$cloud_context/1/revisions/1/view"); - $this->assertResponse(200, t('HTTP 200: View | Cloud server template revision')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: View | Cloud server template revision')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText($old_description); // Revert the revision. $this->drupalPostForm("/clouds/design/server_template/$cloud_context/1/revisions/1/revert", [], - t('Revert')); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template revision')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Revert')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template revision')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Check the string: 'The cloud server template %title has been reverted to // the revision from %revision-date.'. - $this->assertText(t('The cloud server template @name has been reverted to the revision from', [ + $this->assertText($this->t('The cloud server template @name has been reverted to the revision from', [ '@name' => $edit['name[0][value]'], ])); // The new revision is created. @@ -334,13 +334,13 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Delete the revision. $this->drupalPostForm("/clouds/design/server_template/$cloud_context/1/revisions/1/delete", [], - t('Delete')); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template revision')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Delete')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template revision')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Check the part of the string: 'Revision from %revision-date of cloud // server template %title has been deleted.'. - $this->assertText(t('of cloud server template @name has been deleted.', [ + $this->assertText($this->t('of cloud server template @name has been deleted.', [ '@name' => $edit['name[0][value]'], ])); // The revision is deleted. @@ -352,7 +352,7 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $this->clickLink('Copy'); $copy_url = $this->getUrl(); $this->drupalPostForm($copy_url, [], 'Copy'); - $this->assertText(t('Created the copy_of_@name cloud server template', ['@name' => $add[0]['name[0][value]']])); + $this->assertText($this->t('Created the copy_of_@name cloud server template', ['@name' => $add[0]['name[0][value]']])); $this->assertText("copy_of_{$add[0]['name[0][value]']}"); } @@ -367,10 +367,10 @@ class CloudServerTemplateTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); $this->createSecurityGroupTestEntity(0, '', '', '', $cloud_context); $this->createKeyPairTestEntity(0, '', '', $cloud_context); @@ -403,15 +403,15 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/design/server_template/$cloud_context/aws_cloud/add", $add[$i], - t('Save')); - $this->assertResponse(200, t('HTTP 200: Add | The new CloudServerTemplate Form #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Save')); + $this->assertResponse(200, $this->t('HTTP 200: Add | The new CloudServerTemplate Form #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Created the @name cloud server template', [ + $this->t('Created the @name cloud server template', [ '@name' => $add[$i]['name[0][value]'], ]), - t('Confirm Message: Created the @name cloud server template', [ + $this->t('Confirm Message: Created the @name cloud server template', [ '@name' => $add[$i]['name[0][value]'], ]) ); @@ -425,14 +425,14 @@ class CloudServerTemplateTest extends AwsCloudTestCase { $copy[$i]['field_image_id'] = $image_id; $this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/copy", $copy[$i], - t('Copy')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->t('Copy')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Created the @name cloud server template', [ + $this->t('Created the @name cloud server template', [ '@name' => $copy[$i]['name[0][value]'], ]), - t('Confirm Message: Created the @name cloud server template', [ + $this->t('Confirm Message: Created the @name cloud server template', [ '@name' => $copy[$i]['name[0][value]'], ]) ); diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ElasticIpTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ElasticIpTest.php index 7a5cb757..c54faaa1 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ElasticIpTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ElasticIpTest.php @@ -60,9 +60,9 @@ class ElasticIpTest extends AwsCloudTestCase { // List Elastic IP for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip"); - $this->assertResponse(200, t('List | HTTP 200: Elastic IP')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('List | HTTP 200: Elastic IP')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Make sure w/o Warnings')); $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip/add"); @@ -77,38 +77,38 @@ class ElasticIpTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/elastic_ip/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText($add[$i]['name'], t('Elastic IP: @name', ['@name' => $add[$i]['name']])); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($add[$i]['name'], $this->t('Elastic IP: @name', ['@name' => $add[$i]['name']])); $this->assertText( - t('The AWS Cloud Elastic IP "@name', [ + $this->t('The AWS Cloud Elastic IP "@name', [ '@name' => $add[$i]['name'], ]), - t('Confirm Message: The AWS Cloud Elastic IP "@name" has been created.', [ + $this->t('Confirm Message: The AWS Cloud Elastic IP "@name" has been created.', [ '@name' => $add[$i]['name'], ]) ); $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip/$num"); - $this->assertResponse(200, t('Add | View | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | View | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | View | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | View | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | View | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | View | Make sure w/o Warnings')); // Make sure domain is updated. - $this->assertText($domain, t('Add | View | Make sure domain: @domain', ['@domain' => $domain])); + $this->assertText($domain, $this->t('Add | View | Make sure domain: @domain', ['@domain' => $domain])); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip"); - $this->assertResponse(200, t('Add | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText( $add[$j]['name'], - t('Add | List | Make sure w/ Listing: @name', [ + $this->t('Add | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ]) ); @@ -125,28 +125,28 @@ class ElasticIpTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('Edit | HTTP 200: The new AWS Cloud Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | HTTP 200: The new AWS Cloud Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Elastic IP "@name" has been saved.', [ + $this->t('The AWS Cloud Elastic IP "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]), - t('Confirm Message: Edit | The AWS Cloud Elastic IP "@name" has been saved.', [ + $this->t('Confirm Message: Edit | The AWS Cloud Elastic IP "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($edit[$j]['name'], - t('Make sure w/ Listing: @name', [ + $this->t('Make sure w/ Listing: @name', [ '@name' => $edit[$j]['name'], ])); } @@ -160,35 +160,35 @@ class ElasticIpTest extends AwsCloudTestCase { $num = $i + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/delete"); - $this->assertResponse(200, t('Delete | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/delete", [], - t('Delete')); + $this->t('Delete')); - $this->assertResponse(200, t('Delete | HTTP 200: The Cloud Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); - $this->assertText($edit[$i]['name'], t('Name: @name', ['@name' => $edit[$i]['name']])); + $this->assertResponse(200, $this->t('Delete | HTTP 200: The Cloud Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); + $this->assertText($edit[$i]['name'], $this->t('Name: @name', ['@name' => $edit[$i]['name']])); $this->assertText( - t('The AWS Cloud Elastic IP "@name" has been deleted.', [ + $this->t('The AWS Cloud Elastic IP "@name" has been deleted.', [ '@name' => $edit[$i]['name'], ]), - t('Confirm Message: Delete | The AWS Cloud Elastic IP "@name" has been deleted.', [ + $this->t('Confirm Message: Delete | The AWS Cloud Elastic IP "@name" has been deleted.', [ '@name' => $edit[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip"); - $this->assertResponse(200, t('Delete | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertNoText($edit[$j]['name'], - t('Delete | List | Make sure w/ Listing: @name', [ + $this->t('Delete | List | Make sure w/ Listing: @name', [ '@name' => $edit[$j]['name'], ])); } @@ -257,7 +257,7 @@ class ElasticIpTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/elastic_ip", $data, - t('Apply to selected items') + $this->t('Apply to selected items') ); $this->assertResponse(200); @@ -278,7 +278,7 @@ class ElasticIpTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/elastic_ip/delete_multiple", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); @@ -296,8 +296,8 @@ class ElasticIpTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Elastic IPs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Elastic IPs.')); foreach ($elastic_ips as $elastic_ip) { $name = $elastic_ip['Name']; @@ -367,7 +367,7 @@ class ElasticIpTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/elastic_ip", $data, - t('Apply to selected items') + $this->t('Apply to selected items') ); $this->assertResponse(200); @@ -385,7 +385,7 @@ class ElasticIpTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/elastic_ip/disassociate_multiple", [], - t('Disassociate') + $this->t('Disassociate') ); $this->assertResponse(200); @@ -404,8 +404,8 @@ class ElasticIpTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Elastic IPs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Elastic IPs.')); // Make sure if disassociated from an instance. foreach ($elastic_ips as $elastic_ip) { @@ -432,23 +432,23 @@ class ElasticIpTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Elastic IPs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Elastic IPs.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -460,25 +460,25 @@ class ElasticIpTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/edit"); - $this->assertLink(t('Associate Elastic IP')); + $this->assertLink($this->t('Associate Elastic IP')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/associate"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/delete"); - $this->assertLink(t('List AWS Cloud Elastic IPs')); + $this->assertLink($this->t('List AWS Cloud Elastic IPs')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Elastic IPs')); - $this->assertResponse(200, t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Elastic IPs')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertLink(t('Associate Elastic IP')); + $this->assertNoLink($this->t('Edit')); + $this->assertLink($this->t('Associate Elastic IP')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/associate"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/delete"); } @@ -499,23 +499,23 @@ class ElasticIpTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Elastic IPs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Elastic IPs.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -527,11 +527,11 @@ class ElasticIpTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip/$num"); - $this->assertLink(t('Disassociate')); + $this->assertLink($this->t('Disassociate')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/edit"); - $this->assertLink(t('Disassociate Elastic IP')); + $this->assertLink($this->t('Disassociate Elastic IP')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/elastic_ip/$num/disassociate"); } @@ -552,7 +552,7 @@ class ElasticIpTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertLink($add[$i]['tags_name']); @@ -574,7 +574,7 @@ class ElasticIpTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -598,7 +598,7 @@ class ElasticIpTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -612,23 +612,23 @@ class ElasticIpTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/elastic_ip"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num + 1])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Elastic IP #@num', ['@num' => $num + 1])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Elastic IPs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Elastic IPs.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_ELASTIC_IP_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ImageTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ImageTest.php index 2525840f..b759524a 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ImageTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/ImageTest.php @@ -56,9 +56,9 @@ class ImageTest extends AwsCloudTestCase { // List Image for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('List | HTTP 200: Image')); - $this->assertNoText(t('Notice'), t('List | ake sure w/o Notice')); - $this->assertNoText(t('warning'), t('List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('List | HTTP 200: Image')); + $this->assertNoText($this->t('Notice'), $this->t('List | ake sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('List | Make sure w/o Warnings')); // Register a new Image. $add = $this->createImageTestFormData(self::AWS_CLOUD_IMAGE_REPEAT_COUNT); @@ -69,32 +69,32 @@ class ImageTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/image/add", $add[$i], - t('Save')); - $this->assertResponse(200, t('Add | HTTP 200: The new Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText($add[$i]['name'], t('Name: @name', ['@name' => $add[$i]['name']])); + $this->t('Save')); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($add[$i]['name'], $this->t('Name: @name', ['@name' => $add[$i]['name']])); $this->assertText( - t('The AWS Cloud Image "@name', ['@name' => $add[$i]['name']]), - t('Confirm Message: Add | The AWS Cloud Image "@name" has been created.', [ + $this->t('The AWS Cloud Image "@name', ['@name' => $add[$i]['name']]), + $this->t('Confirm Message: Add | The AWS Cloud Image "@name" has been created.', [ '@name' => $add[$i]['name'], ])); // Make sure View. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image/$num"); - $this->assertResponse(200, t('Add | View | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | View | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | View | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | View | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | View | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | View | Make sure w/o Warnings')); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('Add | List | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | List | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($add[$j]['name'], - t('Add | List | Make sure w/ Listing: @name', [ + $this->t('Add | List | Make sure w/ Listing: @name', [ '@name' => $add[$j]['name'], ])); } @@ -109,29 +109,29 @@ class ImageTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/image/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('HTTP 200: Edit | The new Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Make sure w/o Warnings')); - $this->assertText($add[$i]['name'], t('Name: @name', ['@name' => $add[$i]['name']])); + $this->assertResponse(200, $this->t('HTTP 200: Edit | The new Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Make sure w/o Warnings')); + $this->assertText($add[$i]['name'], $this->t('Name: @name', ['@name' => $add[$i]['name']])); // Make sure the description. $this->assertFieldByName('description', $edit[$i]['description']); $this->assertText( - t('The AWS Cloud Image "@name" has been saved.', ['@name' => $add[$i]['name']]), - t('Confirm Message: The AWS Cloud Image "@name" has been saved.', [ + $this->t('The AWS Cloud Image "@name" has been saved.', ['@name' => $add[$i]['name']]), + $this->t('Confirm Message: The AWS Cloud Image "@name" has been saved.', [ '@name' => $add[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -145,12 +145,12 @@ class ImageTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('Delete | List | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | List | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertNoText($edit[$i]['name'], - t('Delete | List | Make sure w/ Listing: @name', [ + $this->t('Delete | List | Make sure w/ Listing: @name', [ '@name' => $edit[$i]['name'], ])); } @@ -170,28 +170,28 @@ class ImageTest extends AwsCloudTestCase { // Import image. $this->drupalGet("/clouds/aws_cloud/$cloud_context/images/import"); - $this->assertResponse(200, t('Import | HTTP 200: Image')); - $this->assertNoText(t('Notice'), t('Import | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Import | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Import | HTTP 200: Image')); + $this->assertNoText($this->t('Notice'), $this->t('Import | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Import | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/images/import", ['image_ids' => $image_id], - t('Import')); - $this->assertResponse(200, t('Import | HTTP 200: The new Cloud Image')); - $this->assertNoText(t('Notice'), t('Import | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Import | Make sure w/o Warnings')); - $this->assertText('Imported 1 images', t('Imported 1 images')); - $this->assertText($image_id, t('Image ID: @image_id', ['@image_id' => $image_id])); + $this->t('Import')); + $this->assertResponse(200, $this->t('Import | HTTP 200: The new Cloud Image')); + $this->assertNoText($this->t('Notice'), $this->t('Import | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Import | Make sure w/o Warnings')); + $this->assertText('Imported 1 images', $this->t('Imported 1 images')); + $this->assertText($image_id, $this->t('Image ID: @image_id', ['@image_id' => $image_id])); $num = 1; // View image. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image/$num"); - $this->assertResponse(200, t('Add | View | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | View | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | View | Make sure w/o Warnings')); - $this->assertText($image_id, t('Image ID: @image_id', ['@image_id' => $image_id])); - $this->assertText("$product_code1,$product_code2", t('Product code: @product_code1,@product_code2', [ + $this->assertResponse(200, $this->t('Add | View | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | View | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | View | Make sure w/o Warnings')); + $this->assertText($image_id, $this->t('Image ID: @image_id', ['@image_id' => $image_id])); + $this->assertText("$product_code1,$product_code2", $this->t('Product code: @product_code1,@product_code2', [ '@product_code1' => $product_code1, '@product_code2' => $product_code2, ])); @@ -201,11 +201,11 @@ class ImageTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('Delete | List | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | List | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | List | Make sure w/o Warnings')); $this->assertNoText($name, - t('Delete | List | Make sure w/ Listing: @name', [ + $this->t('Delete | List | Make sure w/ Listing: @name', [ '@name' => $name, ])); } @@ -241,20 +241,20 @@ class ImageTest extends AwsCloudTestCase { */ private function deleteImage($cloud_context, $num, $name) { $this->drupalGet("/clouds/aws_cloud/$cloud_context/image/$num/delete"); - $this->assertResponse(200, t('Delete | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/image/$num/delete", [], - t('Delete')); + $this->t('Delete')); - $this->assertResponse(200, t('Delete | HTTP 200: The Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); - $this->assertText($name, t('Name: @name', ['@name' => $name])); + $this->assertResponse(200, $this->t('Delete | HTTP 200: The Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); + $this->assertText($name, $this->t('Name: @name', ['@name' => $name])); $this->assertText( - t('The AWS Cloud Image "@name" has been deleted.', ['@name' => $name]), - t('Confirm Message : Delete | The AWS Cloud Image "@name" has been deleted.', [ + $this->t('The AWS Cloud Image "@name" has been deleted.', ['@name' => $name]), + $this->t('Confirm Message : Delete | The AWS Cloud Image "@name" has been deleted.', [ '@name' => $name, ]) ); @@ -278,23 +278,23 @@ class ImageTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Images.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Images.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -306,21 +306,21 @@ class ImageTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/image/$num/edit"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/image/$num/delete"); - $this->assertLink(t('List AWS Cloud Images')); + $this->assertLink($this->t('List AWS Cloud Images')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Images')); - $this->assertResponse(200, t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Images')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertLink(t('Delete')); + $this->assertNoLink($this->t('Edit')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/image/$num/delete"); } @@ -335,22 +335,22 @@ class ImageTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); $this->assertNoText($data['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $data['name'], ])); // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Images.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Images.')); $add = array_merge($add, [$data]); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT + 1; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -371,7 +371,7 @@ class ImageTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT; $i++) { $this->assertLink($add[$i]['tags_name']); @@ -393,7 +393,7 @@ class ImageTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -417,7 +417,7 @@ class ImageTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -444,23 +444,23 @@ class ImageTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Image #@num', ['@num' => $num + 1])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Image #@num', ['@num' => $num + 1])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT + 1; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Images.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Images.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_IMAGE_REPEAT_COUNT + 1; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceExtraTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceExtraTest.php index 16dfbfb2..f20ab66e 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceExtraTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceExtraTest.php @@ -107,21 +107,21 @@ class InstanceExtraTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); - $this->assertText($add[$i]['image_id'], t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertText($add[$i]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -130,14 +130,14 @@ class InstanceExtraTest extends AwsCloudTestCase { $this->addInstanceMockData($add[$i]['name'], $add[$i]['key_pair_name'], 'stopped'); $this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/launch", [], - t('Launch')); + $this->t('Launch')); - $this->assertResponse(200, t('HTTP 200: Launch | The new Cloud Instance @num', [ + $this->assertResponse(200, $this->t('HTTP 200: Launch | The new Cloud Instance @num', [ '@num' => $num, ])); - $this->assertNoText(t('Notice'), t('Launch | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Launch | Make sure w/o Warnings')); - $this->assertText('stopped', t('Instance Type: stopped')); + $this->assertNoText($this->t('Notice'), $this->t('Launch | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Launch | Make sure w/o Warnings')); + $this->assertText('stopped', $this->t('Instance Type: stopped')); // Edit instance. unset( @@ -162,22 +162,22 @@ class InstanceExtraTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/instance/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); $this->updateInstanceMockData($i, $edit[$i]['name']); - $this->assertResponse(200, t('Edit | HTTP 200: The new Instance #@num', [ + $this->assertResponse(200, $this->t('Edit | HTTP 200: The new Instance #@num', [ '@num' => $num, ])); - $this->assertNoText(t('Notice'), t('Edit | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | Make sure w/o Warnings')); + $this->assertNoText($this->t('Notice'), $this->t('Edit | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Instance "@name" has been saved.', ['@name' => $edit[$i]['name']]), - t('Confirm Message: Edit | The AWS Cloud Instance "@name" has been saved.', [ + $this->t('The AWS Cloud Instance "@name" has been saved.', ['@name' => $edit[$i]['name']]), + $this->t('Confirm Message: Edit | The AWS Cloud Instance "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]) ); - $this->assertText(t( + $this->assertText($this->t( 'The User Data of Instance "@name" was updated. Please start the Instance to reflect the User Data.', [ '@name' => $edit[$i]['name'], ]) @@ -185,16 +185,16 @@ class InstanceExtraTest extends AwsCloudTestCase { // Verify instance attributes. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num"); - $this->assertResponse(200, t('View | HTTP 200: The Cloud Instance @num', [ + $this->assertResponse(200, $this->t('View | HTTP 200: The Cloud Instance @num', [ '@num' => $num, ])); - $this->assertNoText(t('Notice'), t('View | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('View | Make sure w/o Warnings')); - $this->assertText($instance_type, t('Instance Type: @instance_types', ['@instance_types' => $instance_type])); + $this->assertNoText($this->t('Notice'), $this->t('View | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('View | Make sure w/o Warnings')); + $this->assertText($instance_type, $this->t('Instance Type: @instance_types', ['@instance_types' => $instance_type])); $groups = implode(', ', $edit[$i]['security_groups[]']); $this->assertText( $groups, - t('Security Groups: @groups', ['@groups' => $groups]) + $this->t('Security Groups: @groups', ['@groups' => $groups]) ); $this->assertText($edit[$i]['user_data']); } @@ -234,7 +234,7 @@ class InstanceExtraTest extends AwsCloudTestCase { 'aws_cloud_instance_terminate' => $terminate_value, 'google_credential' => json_encode([]), ], - t('Save configuration') + $this->t('Save configuration') ); $this->assertResponse(200); @@ -243,21 +243,21 @@ class InstanceExtraTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); - $this->assertText($add[$i]['image_id'], t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertText($add[$i]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -312,21 +312,21 @@ class InstanceExtraTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity)')); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity)')); - $this->assertText($add[$i]['image_id'], t('Image | Make sure w/ Image ID (TestFormData)')); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity)')); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity)')); + $this->assertText($add[$i]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData)')); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -335,17 +335,17 @@ class InstanceExtraTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/launch", ['schedule' => $schedule_value], - t('Launch')); + $this->t('Launch')); - $this->assertResponse(200, t('HTTP 200: Launch | The new Cloud Instance @num', [ + $this->assertResponse(200, $this->t('HTTP 200: Launch | The new Cloud Instance @num', [ '@num' => $num, ])); - $this->assertNoText(t('Notice'), t('Launch | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Launch | Make sure w/o Warnings')); + $this->assertNoText($this->t('Notice'), $this->t('Launch | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Launch | Make sure w/o Warnings')); // Go to the instance page. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num"); - $this->assertText($schedule_value, t('Schedule')); + $this->assertText($schedule_value, $this->t('Schedule')); } } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTest.php index d8015fec..842744b7 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTest.php @@ -90,9 +90,9 @@ class InstanceTest extends AwsCloudTestCase { // List Instance for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/instance"); - $this->assertResponse(200, t('HTTP 200: List | Instance')); - $this->assertNoText(t('Notice'), t('List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Instance')); + $this->assertNoText($this->t('Notice'), $this->t('List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('List | Make sure w/o Warnings')); // Launch a new Instance. $add = $this->createInstanceTestFormData(self::AWS_CLOUD_INSTANCE_REPEAT_COUNT); @@ -103,21 +103,21 @@ class InstanceTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); - $this->assertText($add[$i]['image_id'], t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertText($add[$i]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -125,15 +125,15 @@ class InstanceTest extends AwsCloudTestCase { $this->addInstanceMockData($add[$i]['name'], $add[$i]['key_pair_name']); $this->drupalPostForm("/clouds/design/server_template/${cloud_context}/{$server_template->id()}/launch", [], - t('Launch')); + $this->t('Launch')); - $this->assertResponse(200, t('HTTP 200: Launch | The new Cloud Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Launch | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Launch | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Launch | The new Cloud Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Launch | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Launch | Make sure w/o Warnings')); // Make sure listing. for ($j = 0; $j < $i + 1; $j++) { - $this->assertText($add[$j]['name'], t('Make sure w/ Listing: @name', [ + $this->assertText($add[$j]['name'], $this->t('Make sure w/ Listing: @name', [ '@name' => $add[$j]['name'], ])); } @@ -142,12 +142,12 @@ class InstanceTest extends AwsCloudTestCase { for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { // Make sure the all instance listing exists. $this->drupalGet('/clouds/aws_cloud'); - $this->assertResponse(200, t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { - $this->assertText($add[$j]['name'], t('Make sure w/ Listing: @name', [ + $this->assertText($add[$j]['name'], $this->t('Make sure w/ Listing: @name', [ '@name' => $add[$j]['name'], ])); } @@ -192,13 +192,13 @@ class InstanceTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/instance/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); // Termination validation. $this->assertText( - t( + $this->t( '"@name1" should be left blank if "@name2" is selected. Please leave "@name1" blank or unselect "@name2".', - ['@name1' => t('Termination Date'), '@name2' => t('Termination Protection')] + ['@name1' => $this->t('Termination Date'), '@name2' => $this->t('Termination Protection')] ), 'Termination validation' ); unset($edit[$i]['termination_timestamp[0][value][date]']); @@ -207,16 +207,16 @@ class InstanceTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/instance/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); $this->updateInstanceMockData($i, $edit[$i]['name']); - $this->assertResponse(200, t('Edit | HTTP 200: The new Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | HTTP 200: The new Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Instance "@name" has been saved.', ['@name' => $edit[$i]['name']]), - t('Confirm Message: Edit | The AWS Cloud Instance "@name" has been saved.', [ + $this->t('The AWS Cloud Instance "@name" has been saved.', ['@name' => $edit[$i]['name']]), + $this->t('Confirm Message: Edit | The AWS Cloud Instance "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]) ); @@ -226,13 +226,13 @@ class InstanceTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText( $edit[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $edit[$i]['name'], ]) ); @@ -243,34 +243,34 @@ class InstanceTest extends AwsCloudTestCase { for ($i = 0, $num = 1; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++, $num++) { $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num/terminate"); - $this->assertResponse(200, t('Terminate: HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Terminate | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Terminate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Terminate: HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Terminate | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Terminate | Make sure w/o Warnings')); $this->deleteFirstInstanceMockData(); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/instance/$num/terminate", [], - t('Delete | Terminate')); + $this->t('Delete | Terminate')); - $this->assertResponse(200, t('Terminate | HTTP 200: The Cloud Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Terminate | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Terminate | Make sure w/o Warnings')); - $this->assertText($edit[$i]['name'], t('Instance Name: @name', ['@name' => $edit[$i]['name']])); + $this->assertResponse(200, $this->t('Terminate | HTTP 200: The Cloud Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Terminate | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Terminate | Make sure w/o Warnings')); + $this->assertText($edit[$i]['name'], $this->t('Instance Name: @name', ['@name' => $edit[$i]['name']])); $this->assertText( - t('The AWS Cloud Instance "@name" has been terminated.', ['@name' => $edit[$i]['name']]), - t('Confirm Message: Terminate | The AWS Cloud Instance "@name" has been terminated.', [ + $this->t('The AWS Cloud Instance "@name" has been terminated.', ['@name' => $edit[$i]['name']]), + $this->t('Confirm Message: Terminate | The AWS Cloud Instance "@name" has been terminated.', [ '@name' => $edit[$i]['name'], ])); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance"); - $this->assertResponse(200, t('Terminate | HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Terminate | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Terminate | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Terminate | HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Terminate | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Terminate | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertNoText($edit[$i]['name'], - t('Terminate | List | Make sure w/ Listing: @name', [ + $this->t('Terminate | List | Make sure w/ Listing: @name', [ '@name' => $edit[$i]['name'], ])); } @@ -296,21 +296,21 @@ class InstanceTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); - $this->assertText($add[0]['image_id'], t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[0]['image_id']])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertText($add[0]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[0]['image_id']])); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => 1])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => 1])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -319,10 +319,10 @@ class InstanceTest extends AwsCloudTestCase { $this->addInstanceMockData($add[0]['name'], $add[0]['key_pair_name']); $this->drupalPostForm("/clouds/design/server_template/$cloud_context/1/launch", [], - t('Launch')); - $this->assertResponse(200, t('HTTP 200: Launch | The new Cloud Instance 1')); - $this->assertNoText(t('Notice'), t('Launch | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Launch | Make sure w/o Warnings')); + $this->t('Launch')); + $this->assertResponse(200, $this->t('HTTP 200: Launch | The new Cloud Instance 1')); + $this->assertNoText($this->t('Notice'), $this->t('Launch | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Launch | Make sure w/o Warnings')); // Change security groups. $security_group_name1 = $this->random->name(8, TRUE); @@ -344,18 +344,18 @@ class InstanceTest extends AwsCloudTestCase { // Verify schedule tag. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/1"); - $this->assertResponse(200, t('View | HTTP 200: The Cloud Instance 1')); - $this->assertNoText(t('Notice'), t('View | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('View | Make sure w/o Warnings')); - $this->assertText("$schedule_value", t('Schedule')); + $this->assertResponse(200, $this->t('View | HTTP 200: The Cloud Instance 1')); + $this->assertNoText($this->t('Notice'), $this->t('View | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('View | Make sure w/o Warnings')); + $this->assertText("$schedule_value", $this->t('Schedule')); // Verify security group. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/1"); - $this->assertResponse(200, t('View | HTTP 200: The Cloud Instance 1')); - $this->assertNoText(t('Notice'), t('View | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('View | Make sure w/o Warnings')); - $this->assertText("$security_group_name1, $security_group_name2", t('Security Group')); - $this->assertText($instance_type, t('Instance Type')); + $this->assertResponse(200, $this->t('View | HTTP 200: The Cloud Instance 1')); + $this->assertNoText($this->t('Notice'), $this->t('View | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('View | Make sure w/o Warnings')); + $this->assertText("$security_group_name1, $security_group_name2", $this->t('Security Group')); + $this->assertText($instance_type, $this->t('Instance Type')); } /** @@ -390,21 +390,21 @@ class InstanceTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); - $this->assertText($add[$i]['image_id'], t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertText($add[$i]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -414,14 +414,14 @@ class InstanceTest extends AwsCloudTestCase { 'terminate' => '1', 'termination_protection' => '1', ], - t('Launch') + $this->t('Launch') ); $this->assertText( - t('"@name1" and "@name2" can\'t be selected both. Please unselect one of them.', + $this->t('"@name1" and "@name2" can\'t be selected both. Please unselect one of them.', [ - '@name1' => t('Termination Protection'), - '@name2' => t('Automatically terminate instance'), + '@name1' => $this->t('Termination Protection'), + '@name2' => $this->t('Automatically terminate instance'), ] ), 'Launch validation' @@ -448,21 +448,21 @@ class InstanceTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); - $this->assertText($add[0]['image_id'], t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[0]['image_id']])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => 1])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertText($add[0]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[0]['image_id']])); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => 1])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => 1])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -475,23 +475,23 @@ class InstanceTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Instances.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Instances.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -501,34 +501,34 @@ class InstanceTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/edit"); - $this->assertNoLink(t('Start')); - $this->assertLink(t('Stop')); + $this->assertNoLink($this->t('Start')); + $this->assertLink($this->t('Stop')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/stop"); - $this->assertLink(t('Reboot')); + $this->assertLink($this->t('Reboot')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/reboot"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/terminate"); - $this->assertNoLink(t('Associate Elastic IP')); - $this->assertLink(t('List AWS Cloud Instances')); + $this->assertNoLink($this->t('Associate Elastic IP')); + $this->assertLink($this->t('List AWS Cloud Instances')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Instances')); - $this->assertResponse(200, t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Instances')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertNoLink(t('Start')); - $this->assertLink(t('Stop')); - $this->assertLink(t('Reboot')); + $this->assertNoLink($this->t('Edit')); + $this->assertNoLink($this->t('Start')); + $this->assertLink($this->t('Stop')); + $this->assertLink($this->t('Reboot')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/reboot"); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/stop"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/terminate"); - $this->assertNoLink(t('Associate Elastic IP')); + $this->assertNoLink($this->t('Associate Elastic IP')); } // Edit Instance information. @@ -547,23 +547,23 @@ class InstanceTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Instances.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Instances.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -575,27 +575,27 @@ class InstanceTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/edit"); - $this->assertLink(t('Start')); + $this->assertLink($this->t('Start')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/start"); - $this->assertNoLink(t('Stop')); - $this->assertNoLink(t('Reboot')); - $this->assertLink(t('Delete')); + $this->assertNoLink($this->t('Stop')); + $this->assertNoLink($this->t('Reboot')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/terminate"); - $this->assertLink(t('Associate Elastic IP')); + $this->assertLink($this->t('Associate Elastic IP')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/associate_elastic_ip"); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertLink(t('Start')); + $this->assertNoLink($this->t('Edit')); + $this->assertLink($this->t('Start')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/start"); - $this->assertNoLink(t('Stop')); - $this->assertNoLink(t('Reboot')); - $this->assertLink(t('Delete')); + $this->assertNoLink($this->t('Stop')); + $this->assertNoLink($this->t('Reboot')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/terminate"); - $this->assertLink(t('Associate Elastic IP')); + $this->assertLink($this->t('Associate Elastic IP')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/instance/$num/associate_elastic_ip"); } @@ -615,7 +615,7 @@ class InstanceTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['name']); @@ -639,7 +639,7 @@ class InstanceTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['name']); @@ -661,7 +661,7 @@ class InstanceTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertLink($add[$i]['name']); @@ -674,23 +674,23 @@ class InstanceTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Instance #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Instances.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Instances.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_INSTANCE_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -728,21 +728,21 @@ class InstanceTest extends AwsCloudTestCase { // Make sure if the image entity is created or not. $this->drupalGet("/clouds/aws_cloud/${cloud_context}/image"); - $this->assertResponse(200, t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('Image | Make sure w/o Warnings')); - $this->assertText($image->getName(), t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); - $this->assertText($image->getImageId(), t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); - $this->assertText($add[$i]['image_id'], t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); + $this->assertResponse(200, $this->t('HTTP 200: Image | The new AWS Cloud Image #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('Image | Make sure w/o Warnings')); + $this->assertText($image->getName(), $this->t('Image | Make sure w/ Image Name (TestEntity): @name', ['@name' => $image->getName()])); + $this->assertText($image->getImageId(), $this->t('Image | Make sure w/ Image ID (TestEntity): @image_id', ['@image_id' => $image->getImageId()])); + $this->assertText($add[$i]['image_id'], $this->t('Image | Make sure w/ Image ID (TestFormData): @image_id', ['@image_id' => $add[$i]['image_id']])); // Setup cloud server template and instance. $server_template = $this->createServerTemplateTestEntity($iam_roles, $image, $cloud_context); // Make sure if the cloud_server_template entity is created or not. $this->drupalGet("/clouds/design/server_template/${cloud_context}"); - $this->assertResponse(200, t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); - $this->assertNoText(t('warning'), t('CloudServerTemplate | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: CloudServerTemplate | The new CloudServerTemplate #@num', ['@num' => $num])); + $this->assertNoText($this->t('warning'), $this->t('CloudServerTemplate | Make sure w/o Warnings')); $this->assertText($server_template->name->value, - t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ + $this->t('CloudServerTemplate | Make sure w/ CloudServerTemplate Name: @name', [ '@name' => $server_template->name->value, ]) ); @@ -750,22 +750,22 @@ class InstanceTest extends AwsCloudTestCase { $this->addInstanceMockData($add[$i]['name'], $add[$i]['key_pair_name']); $this->drupalPostForm("/clouds/design/server_template/$cloud_context/{$server_template->id()}/launch", [], - t('Launch')); + $this->t('Launch')); - $this->assertResponse(200, t('HTTP 200: Launch | The new Cloud Instance @num', ['@num' => $i])); - $this->assertNoText(t('Notice'), t('Launch | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Launch | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Launch | The new Cloud Instance @num', ['@num' => $i])); + $this->assertNoText($this->t('Notice'), $this->t('Launch | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Launch | Make sure w/o Warnings')); // Make sure instances are available. $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance/$num"); - $this->assertResponse(200, t('HTTP 200: Instance created.')); + $this->assertResponse(200, $this->t('HTTP 200: Instance created.')); // Delete the image used to create instance. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); $this->clickLink('Delete'); $this->drupalPostForm($this->getUrl(), [], - t('Delete')); + $this->t('Delete')); // Test image creation. $image_id = 'ami-' . $this->getRandomAwsId(); @@ -780,7 +780,7 @@ class InstanceTest extends AwsCloudTestCase { $this->updateImageCreationMockData($image_id, $image_name, 'pending'); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/instance/$num/create_image", $image_params, - t('Create Image')); + $this->t('Create Image')); $this->assertText(t("The AWS Cloud Instance @label (@image_id) has been created.", [ '@image_id' => $image_id, @@ -790,13 +790,13 @@ class InstanceTest extends AwsCloudTestCase { // Make sure the image was created. Status should be pending. // Click on the Image link from the image listing page. $this->clickLink($image_name); - $this->assertResponse(200, t('HTTP 200: Image Entity.')); - $this->assertText($image_id, t('Image ID is present')); - $this->assertText('pending', t('Image created in pending state')); + $this->assertResponse(200, $this->t('HTTP 200: Image Entity.')); + $this->assertText($image_id, $this->t('Image ID is present')); + $this->assertText('pending', $this->t('Image created in pending state')); // Go back to listing page. Make sure there is no delete link. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertNoLink('Delete', t('Cannot delete image in pending state')); + $this->assertNoLink('Delete', $this->t('Cannot delete image in pending state')); // Update the image to 'available'. Then delete the image. $this->updateImageCreationMockData($image_id, $image_name, 'available'); @@ -810,7 +810,7 @@ class InstanceTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); // Click into the image. Make sure the status is now available. $this->clickLink($image_name); - $this->assertText('available', t('Image status is available.')); + $this->assertText('available', $this->t('Image status is available.')); // Go back to main listing page. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); @@ -819,16 +819,16 @@ class InstanceTest extends AwsCloudTestCase { $this->clickLink('Delete'); $this->drupalPostForm($this->getUrl(), [], - t('Delete')); - $this->assertResponse(200, t('HTTP 200: Delete', [ + $this->t('Delete')); + $this->assertResponse(200, $this->t('HTTP 200: Delete', [ '@num' => $i, ])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); // Make sure image is deleted. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertNoText($image_id, t('Image deleted')); + $this->assertNoText($image_id, $this->t('Image deleted')); // Test "Failed" Image. Failed Images should be allowed to be deleted. // Reset the image_id and image_name variables. @@ -844,9 +844,9 @@ class InstanceTest extends AwsCloudTestCase { $this->updateImageCreationMockData($image_id, $image_name, 'failed'); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/instance/$num/create_image", $image_params, - t('Create Image')); + $this->t('Create Image')); - $this->assertText(t("The AWS Cloud Instance @label (@image_id) has been created.", [ + $this->assertText($this->t("The AWS Cloud Instance @label (@image_id) has been created.", [ '@image_id' => $image_id, '@label' => $add[$i]['name'], ])); @@ -855,7 +855,7 @@ class InstanceTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); // Make sure the status is now failed. $this->clickLink($image_name); - $this->assertText('failed', t('Image status is failed')); + $this->assertText('failed', $this->t('Image status is failed')); // Go to the main image page. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); @@ -864,16 +864,16 @@ class InstanceTest extends AwsCloudTestCase { $this->clickLink('Delete'); $this->drupalPostForm($this->getUrl(), [], - t('Delete')); - $this->assertResponse(200, t('HTTP 200: Delete', [ + $this->t('Delete')); + $this->assertResponse(200, $this->t('HTTP 200: Delete', [ '@num' => $i, ])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); // Make sure image is deleted. $this->drupalGet("/clouds/aws_cloud/$cloud_context/image"); - $this->assertNoText($image_id, t('Image deleted')); + $this->assertNoText($image_id, $this->t('Image deleted')); } } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTypePriceControllerTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTypePriceControllerTest.php index 64446d52..3146b193 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTypePriceControllerTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/InstanceTypePriceControllerTest.php @@ -41,7 +41,7 @@ class InstanceTypePriceControllerTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance_type_price"); $this->assertResponse(200); - $this->assertText(t('AWS Cloud Instance Type Prices')); + $this->assertText($this->t('AWS Cloud Instance Type Prices')); foreach (aws_cloud_get_instance_types($cloud_context) as $instance_type_data) { $parts = explode(':', $instance_type_data); $this->assertText($parts[0]); @@ -59,7 +59,7 @@ class InstanceTypePriceControllerTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance_type_price"); $this->assertResponse(200); - $this->assertText(t('AWS Cloud Instance Type Prices')); + $this->assertText($this->t('AWS Cloud Instance Type Prices')); foreach ($instance_types as $instance_type_data) { $parts = explode(':', $instance_type_data); $this->assertText($parts[0]); @@ -76,17 +76,17 @@ class InstanceTypePriceControllerTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/instance_type_price"); $this->assertResponse(200); - $this->assertText(t('AWS Cloud Instance Type Prices')); + $this->assertText($this->$this->t('AWS Cloud Instance Type Prices')); foreach ($instance_types as $instance_type_data) { $parts = explode(':', $instance_type_data); $this->assertNoText($parts[0]); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Instance Type Prices.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Instance Type Prices.')); $this->assertResponse(200); - $this->assertText(t('AWS Cloud Instance Type Prices')); + $this->assertText($this->t('AWS Cloud Instance Type Prices')); $new_instance_types = aws_cloud_get_instance_types($cloud_context); foreach ($new_instance_types as $instance_type_data) { $parts = explode(':', $instance_type_data); diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/KeyPairTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/KeyPairTest.php index 1968a116..847953f2 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/KeyPairTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/KeyPairTest.php @@ -53,9 +53,9 @@ class KeyPairTest extends AwsCloudTestCase { // List Key Pair for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair"); - $this->assertResponse(200, t('List | HTTP 200: Key Pair')); - $this->assertNoText(t('Notice'), t('List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('List | HTTP 200: Key Pair')); + $this->assertNoText($this->t('Notice'), $this->t('List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('List | Make sure w/o Warnings')); // Add a new Key Pair. $add = $this->createKeyPairTestFormData(self::AWS_CLOUD_KEY_PAIR_REPEAT_COUNT); @@ -66,29 +66,29 @@ class KeyPairTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/key_pair/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Key Pair "@key_pair_name', [ + $this->t('The AWS Cloud Key Pair "@key_pair_name', [ '@key_pair_name' => $add[$i]['key_pair_name'], ]), - t('Confirm Message: Add | The AWS Cloud Key Pair "@key_pair_name" has been created.', [ + $this->t('Confirm Message: Add | The AWS Cloud Key Pair "@key_pair_name" has been created.', [ '@key_pair_name' => $add[$i]['key_pair_name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair"); - $this->assertResponse(200, t('Add | List | HTTP 200: Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | List | HTTP 200: Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($add[$j]['key_pair_name'], - t('Make sure w/ Listing: @key_pair_name', + $this->t('Make sure w/ Listing: @key_pair_name', ['@key_pair_name' => $add[$j]['key_pair_name']])); } } @@ -99,34 +99,34 @@ class KeyPairTest extends AwsCloudTestCase { $num = $i + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair/$num/delete"); - $this->assertResponse(200, t('Delete | HTTP 200: Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/key_pair/$num/delete", [], - t('Delete')); + $this->t('Delete')); - $this->assertResponse(200, t('Delete | HTTP 200: The Cloud Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); - $this->assertText($add[$i]['key_pair_name'], t('Name: @key_pair_name', ['@key_pair_name' => $add[$i]['key_pair_name']])); + $this->assertResponse(200, $this->t('Delete | HTTP 200: The Cloud Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); + $this->assertText($add[$i]['key_pair_name'], $this->t('Name: @key_pair_name', ['@key_pair_name' => $add[$i]['key_pair_name']])); $this->assertText( - t('The AWS Cloud Key Pair "@key_pair_name" has been deleted.', [ + $this->t('The AWS Cloud Key Pair "@key_pair_name" has been deleted.', [ '@key_pair_name' => $add[$i]['key_pair_name'], ]), - t('Confirm Message: Delete | The AWS Cloud Key Pair "@key_pair_name" has been deleted.', [ + $this->t('Confirm Message: Delete | The AWS Cloud Key Pair "@key_pair_name" has been deleted.', [ '@key_pair_name' => $add[$i]['key_pair_name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair"); - $this->assertResponse(200, t('HTTP 200: Delete | Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Delete | Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertNoText($add[$i]['key_pair_name'], - t('Delete | List | Make sure w/ Listing: @key_pair_name', [ + $this->t('Delete | List | Make sure w/ Listing: @key_pair_name', [ '@key_pair_name' => $add[$i]['key_pair_name'], ])); } @@ -168,23 +168,23 @@ class KeyPairTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_KEY_PAIR_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['key_pair_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['key_pair_name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Key Pairs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Key Pairs.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_KEY_PAIR_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['key_pair_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['key_pair_name'], ])); } @@ -196,21 +196,21 @@ class KeyPairTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/key_pair/$num/edit"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/key_pair/$num/delete"); - $this->assertLink(t('List AWS Cloud Key Pairs')); + $this->assertLink($this->t('List AWS Cloud Key Pairs')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Key Pairs')); - $this->assertResponse(200, t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Key Pairs')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertLink(t('Delete')); + $this->assertNoLink($this->t('Edit')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/key_pair/$num/delete"); } @@ -227,23 +227,23 @@ class KeyPairTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_KEY_PAIR_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['key_pair_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['key_pair_name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Key Pairs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Key Pairs.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_KEY_PAIR_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['key_pair_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['key_pair_name'], ])); } @@ -255,23 +255,23 @@ class KeyPairTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/key_pair"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num + 1])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Key Pair #@num', ['@num' => $num + 1])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_KEY_PAIR_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['key_pair_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['key_pair_name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Key Pairs.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Key Pairs.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_KEY_PAIR_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['key_pair_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['key_pair_name'], ])); } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/NetworkInterfaceTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/NetworkInterfaceTest.php index ee505290..ca3956f5 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/NetworkInterfaceTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/NetworkInterfaceTest.php @@ -44,9 +44,9 @@ class NetworkInterfaceTest extends AwsCloudTestCase { // List Network Interface for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('List | HTTP 200: Network Interface')); - $this->assertNoText(t('Notice'), t('List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('List | HTTP 200: Network Interface')); + $this->assertNoText($this->t('Notice'), $this->t('List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('List | Make sure w/o Warnings')); // Create security groups. $security_groups = $this->createSecurityGroupRandomTestFormData(); @@ -75,33 +75,33 @@ class NetworkInterfaceTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/network_interface/add", $add[$i], - t('Save')); - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); + $this->t('Save')); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Network Interface "@name', [ + $this->t('The AWS Cloud Network Interface "@name', [ '@name' => $add[$i]['name'], ]), - t('Confirm Message: Add | The AWS Cloud Network Interface "@name" has been created.', [ + $this->t('Confirm Message: Add | The AWS Cloud Network Interface "@name" has been created.', [ '@name' => $add[$i]['name'], ]) ); $this->assertText( $add[$i]['name'], - t('Network Interface: @name', [ + $this->t('Network Interface: @name', [ '@name' => $add[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('Add | List | HTTP 200: Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | List | HTTP 200: Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($add[$j]['name'], - t('Make sure w/ Listing: @name', + $this->t('Make sure w/ Listing: @name', ['@name' => $add[$j]['name']])); } } @@ -118,15 +118,15 @@ class NetworkInterfaceTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/network_interface/$num/edit", $edit[$i], - t('Save')); - $this->assertResponse(200, t('Edit | HTTP 200: The new AWS Cloud Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | Make sure w/o Warnings')); + $this->t('Save')); + $this->assertResponse(200, $this->t('Edit | HTTP 200: The new AWS Cloud Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Network Interface "@name" has been saved.', [ + $this-->t('The AWS Cloud Network Interface "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]), - t('Confirm Message: The AWS Cloud Network Interface "@name" has been saved.', [ + $this->t('Confirm Message: The AWS Cloud Network Interface "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]) ); @@ -134,21 +134,21 @@ class NetworkInterfaceTest extends AwsCloudTestCase { $this->assertFieldByName('description', $edit[$i]['description']); $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('Edit List | HTTP 200: Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit List | HTTP 200: Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); - $this->assertText($edit[$i]['name'], t('Network Interface: @name', ['@name' => $edit[$i]['name']])); + $this->assertText($edit[$i]['name'], $this->t('Network Interface: @name', ['@name' => $edit[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($edit[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $edit[$i]['name'], ])); } @@ -158,31 +158,31 @@ class NetworkInterfaceTest extends AwsCloudTestCase { for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $num = $i + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface/$num/delete"); - $this->assertResponse(200, t('HTTP 200: Delete | Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Delete | Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/network_interface/$num/delete", [], - t('Delete')); + $this->t('Delete')); - $this->assertResponse(200, t('Delete | HTTP 200: The Cloud Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); - $this->assertText($edit[$i]['name'], t('Name: @name', ['@name' => $edit[$i]['name']])); + $this->assertResponse(200, $this->t('Delete | HTTP 200: The Cloud Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); + $this->assertText($edit[$i]['name'], $this->t('Name: @name', ['@name' => $edit[$i]['name']])); $this->assertText( - t('The AWS Cloud Network Interface "@name" has been deleted.', [ + $this->t('The AWS Cloud Network Interface "@name" has been deleted.', [ '@name' => $edit[$i]['name'], ]), - t('Confirm Message: Delete | The AWS Cloud Network Interface "@name" has been deleted.', [ + $this->t('Confirm Message: Delete | The AWS Cloud Network Interface "@name" has been deleted.', [ '@name' => $edit[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('Delete | HTTP 200: Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | List | Make sure w/o Warnings')); } } @@ -221,23 +221,23 @@ class NetworkInterfaceTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Network Interfaces.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Network Interfaces.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -249,21 +249,21 @@ class NetworkInterfaceTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/network_interface/$num/edit"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/network_interface/$num/delete"); - $this->assertLink(t('List AWS Cloud Network Interfaces')); + $this->assertLink($this->t('List AWS Cloud Network Interfaces')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Network Interfaces')); - $this->assertResponse(200, t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Network Interfaces')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertLink(t('Delete')); + $this->assertNoLink($this->t('Edit')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/network_interface/$num/delete"); $this->assertNoLink('Edit'); } @@ -281,23 +281,23 @@ class NetworkInterfaceTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Network Interfaces.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Network Interfaces.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -319,7 +319,7 @@ class NetworkInterfaceTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertLink($add[$i]['tags_name']); @@ -341,7 +341,7 @@ class NetworkInterfaceTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -365,7 +365,7 @@ class NetworkInterfaceTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -379,23 +379,23 @@ class NetworkInterfaceTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/network_interface"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num + 1])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Network Interface #@num', ['@num' => $num + 1])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Network Interfaces.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Network Interfaces.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_NETWORK_INTERFACE_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupIpPermissionsTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupIpPermissionsTest.php index eb30e6db..740ba6f3 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupIpPermissionsTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupIpPermissionsTest.php @@ -121,7 +121,7 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { // Click on a specific group. $this->clickLink($defaults['group_name']); - $this->assertText($defaults['group_name'], t('Group Name')); + $this->assertText($defaults['group_name'], $this->t('Group Name')); // Assert permissions. foreach ($rules as $rule) { @@ -133,7 +133,7 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { $this->assertText( $rule[$key], - t("@type @key", + $this->t("@type @key", [ '@type' => $type_name, '@key' => $key, @@ -175,18 +175,18 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/add"); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/add", $add[$i], - t('Save')); + $this->t('Save')); // After save, assert the save is successful. - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText($add[$i]['group_name'], t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($add[$i]['group_name'], $this->t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); $this->assertText( - t('The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ]), - t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ]) ); @@ -210,13 +210,13 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { $params['name'] = $add[$i]['group_name']; $this->drupalPostForm($edit_url, $params, - t('Save')); + $this->t('Save')); $this->assertText( - t('The AWS Cloud Security Group "@name" has been saved.', [ + $this->t('The AWS Cloud Security Group "@name" has been saved.', [ '@name' => $params['name'], ]), - t('Confirm Message: Edit | The AWS Cloud Security Group "@name" has been saved.', [ + $this->t('Confirm Message: Edit | The AWS Cloud Security Group "@name" has been saved.', [ '@name' => $params['name'], ]) ); @@ -259,18 +259,18 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/add"); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/add", $add[$i], - t('Save')); + $this->t('Save')); // After save, assert the save is successful. - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText($add[$i]['group_name'], t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($add[$i]['group_name'], $this->t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); $this->assertText( - t('The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ]), - t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ])); @@ -281,8 +281,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][cidr_ip]' => Utils::getRandomCidr(), 'ip_permission[0][source]' => 'ip4', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('The From Port is not numeric.'), t('Number From Port test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('The From Port is not numeric.'), $this->t('Number From Port test')); // Verify From port validation error. $rules = [ @@ -291,8 +291,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][cidr_ip]' => Utils::getRandomCidr(), 'ip_permission[0][source]' => 'ip4', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('The To Port is not numeric.'), t('Numeric To Port test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('The To Port is not numeric.'), $this->t('Numeric To Port test')); // Verify CIDR IP empty test. $rules = [ @@ -301,8 +301,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][cidr_ip]' => '', 'ip_permission[0][source]' => 'ip4', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('CIDR IP is empty.'), t('CIDR IP empty test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('CIDR IP is empty.'), $this->t('CIDR IP empty test')); // Verify valid CIDR IP address. $rules = [ @@ -311,8 +311,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][cidr_ip]' => Utils::getRandomPublicIp(), 'ip_permission[0][source]' => 'ip4', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('CIDR IP is not valid. Single IP addresses must be in x.x.x.x/32 notation.'), t('CIDR IP valid test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('CIDR IP is not valid. Single IP addresses must be in x.x.x.x/32 notation.'), $this->t('CIDR IP valid test')); // Verify valid CIDR IPv6 address. $rules = [ @@ -321,8 +321,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][cidr_ip_v6]' => Utils::getRandomPublicIp(), 'ip_permission[0][source]' => 'ip6', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('CIDR IPv6 is not valid. Single IP addresses must be in x.x.x.x/32 notation.'), t('CIDR IPv6 valid test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('CIDR IPv6 is not valid. Single IP addresses must be in x.x.x.x/32 notation.'), $this->t('CIDR IPv6 valid test')); // Verify CIDR IPv6 empty test. $rules = [ @@ -331,8 +331,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][cidr_ip]' => '', 'ip_permission[0][source]' => 'ip6', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('CIDR IPv6 is empty.'), t('CIDR IPv6 empty test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('CIDR IPv6 is empty.'), $this->t('CIDR IPv6 empty test')); // Verify Group ID. $rules = [ @@ -341,8 +341,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][group_id]' => '', 'ip_permission[0][source]' => 'group', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('Group ID is empty.'), t('Group ID empty test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('Group ID is empty.'), $this->t('Group ID empty test')); // Verify to port is not greater than from port. $rules = [ @@ -351,8 +351,8 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { 'ip_permission[0][cidr_ip]' => Utils::getRandomCidr(), 'ip_permission[0][source]' => 'ip4', ]; - $this->drupalPostForm($this->getUrl(), $rules, t('Save')); - $this->assertText(t('From Port is greater than To Port.'), t('From port greater than to port test')); + $this->drupalPostForm($this->getUrl(), $rules, $this->t('Save')); + $this->assertText($this->t('From Port is greater than To Port.'), $this->t('From port greater than to port test')); } } @@ -387,18 +387,18 @@ class SecurityGroupIpPermissionsTest extends AwsCloudTestCase { $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/add"); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/add", $add[$i], - t('Save')); + $this->t('Save')); // After save, assert the save is successful. - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText($add[$i]['group_name'], t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($add[$i]['group_name'], $this->t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); $this->assertText( - t('The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ]), - t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ]) ); diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupTest.php index ef2a726a..c6ab5951 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SecurityGroupTest.php @@ -47,12 +47,12 @@ class SecurityGroupTest extends AwsCloudTestCase { // List Security Group for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group"); - $this->assertResponse(200, t('List | HTTP 200: Security Group')); - $this->assertNoText(t('Notice'), t('List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('List | HTTP 200: Security Group')); + $this->assertNoText($this->t('Notice'), $this->t('List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('List | Make sure w/o Warnings')); $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/add"); - $this->assertText(t('You do not have any VPCs. You need a VPC in order to create a security group. You can create a VPC.')); + $this->assertText($this->t('You do not have any VPCs. You need a VPC in order to create a security group. You can create a VPC.')); // Add a new Security Group. $add = $this->createSecurityGroupTestFormData(self::$awsCloudSecurityGroupRepeatCount); @@ -65,9 +65,9 @@ class SecurityGroupTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertText(t('VPC CIDR (ID) field is required.'), t('VPC CIDR is required test.')); + $this->assertText($this->t('VPC CIDR (ID) field is required.'), $this->t('VPC CIDR is required test.')); $defaults = $this->latestTemplateVars; $add[$i]['vpc_id'] = $defaults['vpc_id']; @@ -77,30 +77,30 @@ class SecurityGroupTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText($add[$i]['group_name'], t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Security Group', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($add[$i]['group_name'], $this->t('Add | Key Pair: @group_name', ['@group_name' => $add[$i]['group_name']])); $this->assertText( - t('The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ]), - t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('Confirm Message: Add | The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $add[$i]['group_name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group"); - $this->assertResponse(200, t('Add | List | HTTP 200: List | Security Group #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Add | List | HTTP 200: List | Security Group #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | List | Make sure w/o Warnings')); // 3 times. for ($j = 0; $j < $i + 1; $j++) { $this->assertText($add[$i]['group_name'], - t('Add | List | Make sure w/ Listing: @group_name', [ + $this->t('Add | List | Make sure w/ Listing: @group_name', [ '@group_name' => $add[$i]['group_name'], ])); } @@ -121,27 +121,27 @@ class SecurityGroupTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('Edit | HTTP 200: The new AWS Cloud Security Group #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | HTTP 200: The new AWS Cloud Security Group #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Security Group "@name" has been saved.', [ + $this->t('The AWS Cloud Security Group "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]), - t('Confirm Message: Edit | The AWS Cloud Security Group "@name" has been saved.', [ + $this->t('Confirm Message: Edit | The AWS Cloud Security Group "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Security Group #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Security Group #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); - $this->assertText($edit[$i]['name'], t('key_pair: @name', + $this->assertText($edit[$i]['name'], $this->t('key_pair: @name', ['@name' => $edit[$i]['name']])); } @@ -149,31 +149,31 @@ class SecurityGroupTest extends AwsCloudTestCase { for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount; $i++) { $num = $i + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/$num/delete"); - $this->assertResponse(200, t('Delete | HTTP 200: Security Group #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Security Group #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/$num/delete", [], - t('Delete')); + $this->t('Delete')); - $this->assertResponse(200, t('Delete | HTTP 200: The Cloud Security Group #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); - $this->assertText($add[$i]['group_name'], t('Group Name: @group_name', ['@group_name' => $add[$i]['group_name']])); + $this->assertResponse(200, $this->t('Delete | HTTP 200: The Cloud Security Group #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); + $this->assertText($add[$i]['group_name'], $this->t('Group Name: @group_name', ['@group_name' => $add[$i]['group_name']])); $this->assertText( - t('The AWS Cloud Security Group "@group_name" has been deleted.', [ + $this->t('The AWS Cloud Security Group "@group_name" has been deleted.', [ '@group_name' => $add[$i]['group_name'], ]), - t('Confirm Message: Delete | The AWS Cloud Security Group "@group_name" has been deleted.', [ + $this->t('Confirm Message: Delete | The AWS Cloud Security Group "@group_name" has been deleted.', [ '@group_name' => $add[$i]['group_name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group"); - $this->assertResponse(200, t('HTTP 200: Delete | Security Group #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Delete | Security Group #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | List | Make sure w/o Warnings')); } } @@ -214,23 +214,23 @@ class SecurityGroupTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group"); - $this->assertResponse(200, t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount; $i++) { $this->assertNoText($add[$i]['group_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['group_name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Security Groups.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Security Groups.')); // Make sure listing. for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount; $i++) { $this->assertText($add[$i]['group_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['group_name'], ])); } @@ -242,21 +242,21 @@ class SecurityGroupTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/security_group/$num/edit"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/security_group/$num/delete"); - $this->assertLink(t('List AWS Cloud Security Groups')); + $this->assertLink($this->t('List AWS Cloud Security Groups')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Security Groups')); - $this->assertResponse(200, t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Security Groups')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertLink(t('Delete')); + $this->assertNoLink($this->t('Edit')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/security_group/$num/delete"); $this->assertNoLink('Edit'); } @@ -271,22 +271,22 @@ class SecurityGroupTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group"); - $this->assertResponse(200, t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); $this->assertNoText($data['group_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $data['group_name'], ])); // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Security Groups.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Security Groups.')); $add = array_merge($add, [$data]); // Make sure listing. for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount + 1; $i++) { $this->assertText($add[$i]['group_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['group_name'], ])); } @@ -307,7 +307,7 @@ class SecurityGroupTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount; $i++) { $this->assertLink($add[$i]['tags_name']); @@ -329,7 +329,7 @@ class SecurityGroupTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -353,7 +353,7 @@ class SecurityGroupTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -367,23 +367,23 @@ class SecurityGroupTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group"); - $this->assertResponse(200, t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num + 1])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: SecurityGroup #@num', ['@num' => $num + 1])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount + 1; $i++) { $this->assertText($add[$i]['group_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['group_name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Security Groups.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Security Groups.')); // Make sure listing. for ($i = 0; $i < self::$awsCloudSecurityGroupRepeatCount + 1; $i++) { $this->assertNoText($add[$i]['group_name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['group_name'], ])); } @@ -438,11 +438,11 @@ class SecurityGroupTest extends AwsCloudTestCase { $add[$i]['rules'] = $this->createRulesTestFormData(self::$awsCloudSecurityGroupRulesMix, $edit_url, $add[$i]['group_id'], self::$awsCloudSecurityGroupRulesRepeatCount); $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/$num"); - $this->assertLink(t('Copy')); + $this->assertLink($this->t('Copy')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/security_group/$num/copy"); // Click 'Copy'. - $this->clickLink(t('Copy')); + $this->clickLink($this->t('Copy')); $this->assertText('Copy AWS Cloud Security Group'); $this->assertFieldByName('group_name', "Copy of {$add[$i]['group_name']}"); @@ -454,16 +454,16 @@ class SecurityGroupTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/security_group/$num/copy", $copy[$i], - t('Copy')); + $this->t('Copy')); - $this->assertNoText(t('Notice'), t('Copy | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Copy | Make sure w/o Warnings')); - $this->assertText($copy[$i]['group_name'], t('Copy | Security Group: @group_name', ['@group_name' => $copy[$i]['group_name']])); + $this->assertNoText($this->t('Notice'), $this->t('Copy | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Copy | Make sure w/o Warnings')); + $this->assertText($copy[$i]['group_name'], $this->t('Copy | Security Group: @group_name', ['@group_name' => $copy[$i]['group_name']])); $this->assertText( - t('The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $copy[$i]['group_name'], ]), - t('Confirm Message: Copy | The AWS Cloud Security Group "@group_name" has been created.', [ + $this->t('Confirm Message: Copy | The AWS Cloud Security Group "@group_name" has been created.', [ '@group_name' => $copy[$i]['group_name'], ]) ); @@ -505,7 +505,7 @@ class SecurityGroupTest extends AwsCloudTestCase { $security_group->save(); $this->drupalGet("/clouds/aws_cloud/$cloud_context/security_group/$num/copy"); - $this->assertText(t('You do not have any VPCs. You need a VPC in order to create a security group. You can create a VPC.')); + $this->assertText($this->t('You do not have any VPCs. You need a VPC in order to create a security group. You can create a VPC.')); } } diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SnapshotTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SnapshotTest.php index b5fd9dba..02e3eb77 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SnapshotTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/SnapshotTest.php @@ -50,9 +50,9 @@ class SnapshotTest extends AwsCloudTestCase { // List Snapshot for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('List | HTTP 200: Snapshot')); - $this->assertNoText(t('Notice'), t('List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('List | HTTP 200: Snapshot')); + $this->assertNoText($this->t('Notice'), $this->t('List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('List | Make sure w/o Warnings')); // Create random volumes. $volumes = $this->createVolumesRandomTestFormData(); @@ -83,26 +83,26 @@ class SnapshotTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/snapshot/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('HTTP 200: Add | The new AWS Cloud Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Add | The new AWS Cloud Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Snapshot "@name', ['@name' => $add[$i]['name']]), - t('Confirm Message: The AWS Cloud Snapshot "@name" has been created.', [ + $this->t('The AWS Cloud Snapshot "@name', ['@name' => $add[$i]['name']]), + $this->t('Confirm Message: The AWS Cloud Snapshot "@name" has been created.', [ '@name' => $add[$i]['name'], ])); $this->assertText($add[$i]['name'], - t('key_pair: @name', [ + $this->t('key_pair: @name', [ '@name' => $add[$i]['name'], ])); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('HTTP 200: List | Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | List | Make sure w/o Warnings')); } // Edit an Snapshot information. @@ -116,26 +116,26 @@ class SnapshotTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/snapshot/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('Edit | HTTP 200: The new AWS Cloud Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | HTTP 200: The new AWS Cloud Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Snapshot "@name" has been saved.', ['@name' => $edit[$i]['name']]), - t('Confirm Message: The AWS Cloud Snapshot "@name" has been saved.', [ + $this->t('The AWS Cloud Snapshot "@name" has been saved.', ['@name' => $edit[$i]['name']]), + $this->t('Confirm Message: The AWS Cloud Snapshot "@name" has been saved.', [ '@name' => $edit[$i]['name'], ])); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($edit[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $edit[$i]['name'], ])); } @@ -147,27 +147,27 @@ class SnapshotTest extends AwsCloudTestCase { $num = $i + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot/$num/delete"); - $this->assertResponse(200, t('Delete | HTTP 200: Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/snapshot/$num/delete", [], - t('Delete')); + $this->t('Delete')); - $this->assertResponse(200, t('Delete | HTTP 200: The Cloud Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); - $this->assertText($edit[$i]['name'], t('Name: @name', ['@name' => $edit[$i]['name']])); + $this->assertResponse(200, $this->t('Delete | HTTP 200: The Cloud Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); + $this->assertText($edit[$i]['name'], $this->t('Name: @name', ['@name' => $edit[$i]['name']])); $this->assertText( - t('The AWS Cloud Snapshot "@name" has been deleted.', ['@name' => $edit[$i]['name']]), - t('Confirm Message: Delete | The AWS Cloud Snapshot "@name" has been deleted.', ['@name' => $edit[$i]['name']]) + $this->t('The AWS Cloud Snapshot "@name" has been deleted.', ['@name' => $edit[$i]['name']]), + $this->t('Confirm Message: Delete | The AWS Cloud Snapshot "@name" has been deleted.', ['@name' => $edit[$i]['name']]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('Delete | HTTP 200: Snapshot', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Snapshot', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | List | Make sure w/o Warnings')); } } @@ -192,9 +192,9 @@ class SnapshotTest extends AwsCloudTestCase { $test_cases = $this->createUpdateSnapshotTestCases(); $this->updateDescribeSnapshotsMockData($test_cases); $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot/update"); - $this->assertResponse(200, t('Update | HTTP 200: Snapshot', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Update | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Update | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Update | HTTP 200: Snapshot', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Update | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Update | List | Make sure w/o Warnings')); foreach ($test_cases as $test_case) { $this->assertLink( @@ -222,23 +222,23 @@ class SnapshotTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Snapshots.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Snapshots.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -250,34 +250,34 @@ class SnapshotTest extends AwsCloudTestCase { // Confirm the detailed view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/snapshot/$num/edit"); - $this->assertLink(t('Create Volume')); + $this->assertLink($this->t('Create Volume')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/add?snapshot_id={$add[$i]['name']}"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/snapshot/$num/delete"); - $this->assertLink(t('List AWS Cloud Snapshots')); + $this->assertLink($this->t('List AWS Cloud Snapshots')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Snapshots')); - $this->assertResponse(200, t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Snapshots')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); // Confirm the edit view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot/$num/edit"); - $this->assertNoLink(t('Edit')); - $this->assertLink(t('Create Volume')); + $this->assertNoLink($this->t('Edit')); + $this->assertLink($this->t('Create Volume')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/add?snapshot_id={$add[$i]['name']}"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/snapshot/$num/delete"); $this->assertNoLink('Edit'); // Click "Create Volume" link. - $this->clickLink(t('Create Volume')); + $this->clickLink($this->t('Create Volume')); // Make sure creating page. $this->assertResponse(200); - $this->assertText(t('Add AWS Cloud Volume')); + $this->assertText($this->t('Add AWS Cloud Volume')); // Make sure the default value of field snapshot_id. $this->assertSession()->fieldValueEquals('snapshot_id', $add[$i]['name']); @@ -296,23 +296,23 @@ class SnapshotTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Snapshots.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Snapshots.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -333,7 +333,7 @@ class SnapshotTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['name']); @@ -357,7 +357,7 @@ class SnapshotTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['name']); @@ -380,7 +380,7 @@ class SnapshotTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertLink($add[$i]['name']); @@ -393,23 +393,23 @@ class SnapshotTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num + 1])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Snapshot #@num', ['@num' => $num + 1])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Snapshots.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Snapshots.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SNAPSHOT_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -460,24 +460,24 @@ class SnapshotTest extends AwsCloudTestCase { $num = $i + 1; $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/snapshot/add", $add[$i], - t('Save')); + $this->t('Save')); $this->assertResponse(200); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/snapshot"); - $this->assertResponse(200, t('HTTP 200: List | Snapshot #@num', ['@num' => $num])); - $this->assertText(t('Create Volume')); + $this->assertResponse(200, $this->t('HTTP 200: List | Snapshot #@num', ['@num' => $num])); + $this->assertText($this->t('Create Volume')); // Add snapshot to DescribeSnapshots of Mock data. $snapshot_id = $this->latestTemplateVars['snapshot_id']; $this->addDescribeSnapshotsMockData($snapshot_id); // Click "Create Volume" link. - $this->clickLink(t('Create Volume'), $i); + $this->clickLink($this->t('Create Volume'), $i); // Make sure creating page. $this->assertResponse(200); - $this->assertText(t('Add AWS Cloud Volume')); + $this->assertText($this->t('Add AWS Cloud Volume')); // Make sure the default value of field snapshot_id. $this->assertSession()->fieldValueEquals('snapshot_id', $snapshot_id); diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeAttachDetachTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeAttachDetachTest.php index 77705a97..c6f8a744 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeAttachDetachTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeAttachDetachTest.php @@ -80,12 +80,12 @@ class VolumeAttachDetachTest extends AwsCloudTestCase { $this->updateAttachDetachVolumeMockData('AttachVolume', $device_name, $volume_id, $instance_id, 'attaching'); $this->drupalPostForm("/clouds/aws_cloud/$this->cloudContext/volume/$i/attach", $attach_data, - t('Attach')); + $this->t('Attach')); - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Volume #@num', ['@num' => $i])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText(t('The volume @volume is attaching to @instance', [ + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Volume #@num', ['@num' => $i])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($this->t('The volume @volume is attaching to @instance', [ '@instance' => $instance_id, '@volume' => $volume_id, ])); @@ -97,11 +97,11 @@ class VolumeAttachDetachTest extends AwsCloudTestCase { $this->updateAttachDetachVolumeMockData('DetachVolume', $device_name, $volume_id, $instance_id, 'detaching'); $this->drupalPostForm("/clouds/aws_cloud/$this->cloudContext/volume/$i/detach", [], - t('Detach')); - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Volume #@num', ['@num' => $i])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText(t('The volume @volume is detaching from @instance', [ + $this->t('Detach')); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Volume #@num', ['@num' => $i])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($this->t('The volume @volume is detaching from @instance', [ '@instance' => $instance_id, '@volume' => $volume_id, ])); @@ -156,7 +156,7 @@ class VolumeAttachDetachTest extends AwsCloudTestCase { $this->updateAttachDetachVolumeMockData('AttachVolume', $device_name, $volume_id, $instance_id, 'attaching'); $this->drupalPostForm("/clouds/aws_cloud/$this->cloudContext/volume/$num/attach", $attach_data, - t('Attach')); + $this->t('Attach')); $volume->setState('in-use'); $volume->setAttachmentInformation($instance_id); @@ -186,7 +186,7 @@ class VolumeAttachDetachTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/volume", $data, - t('Apply to selected items') + $this->t('Apply to selected items') ); $this->assertResponse(200); @@ -204,7 +204,7 @@ class VolumeAttachDetachTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/volume/detach_multiple", [], - t('Detach') + $this->t('Detach') ); $this->assertResponse(200); @@ -223,8 +223,8 @@ class VolumeAttachDetachTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Volumes.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Volumes.')); // Make sure if disassociated from an instance. foreach ($total_volumes as $volume) { diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeTest.php index f45dacfd..3b5f287b 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Ec2/VolumeTest.php @@ -48,9 +48,9 @@ class VolumeTest extends AwsCloudTestCase { // List Volume for Amazon EC2. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('HTTP 200: List')); - $this->assertNoText(t('Notice'), t('List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List')); + $this->assertNoText($this->t('Notice'), $this->t('List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('List | Make sure w/o Warnings')); // Add a new Volume. $delete_count = 0; @@ -76,51 +76,51 @@ class VolumeTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/volume/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('Add | HTTP 200: The new AWS Cloud Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | Make sure w/o Warnings')); - $this->assertText($add[$i]['name'], t('Add | Volume: @name', ['@name' => $add[$i]['name']])); + $this->assertResponse(200, $this->t('Add | HTTP 200: The new AWS Cloud Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | Make sure w/o Warnings')); + $this->assertText($add[$i]['name'], $this->t('Add | Volume: @name', ['@name' => $add[$i]['name']])); $this->assertText( - t('The AWS Cloud Volume "@name', ['@name' => $add[$i]['name']]), - t('Confirm Message: Add | The AWS Cloud Volume "@name" has been created.', [ + $this->t('The AWS Cloud Volume "@name', ['@name' => $add[$i]['name']]), + $this->t('Confirm Message: Add | The AWS Cloud Volume "@name" has been created.', [ '@name' => $add[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('HTTP 200: Add | List | Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Add | List | Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($add[$i]['name'], - t('Add | List | Make sure w/ Listing: @name', [ + $this->t('Add | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Assert delete link count. if ($delete_count > 0) { - $this->assertLink(t('Delete'), $delete_count - 1); + $this->assertLink($this->t('Delete'), $delete_count - 1); } // Make sure view. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume/$num"); - $this->assertResponse(200, t('HTTP 200: Add | View | Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Add | View | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Add | View | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Add | View | Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Add | View | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Add | View | Make sure w/o Warnings')); $this->assertText($volume_id, - t('Add | View | Make sure volume id: @volume_id', [ + $this->t('Add | View | Make sure volume id: @volume_id', [ '@volume_id' => $volume_id, ])); $this->assertText($add[$i]['snapshot_id'], - t('Add | View | Make sure snapshot id: @snapshot_id', [ + $this->t('Add | View | Make sure snapshot id: @snapshot_id', [ '@snapshot_id' => $add[$i]['snapshot_id'], ])); $this->assertText($snapshot_name, - t('Add | View | Make sure snapshot name: @snapshot_name', [ + $this->t('Add | View | Make sure snapshot name: @snapshot_name', [ '@snapshot_name' => $snapshot_name, ])); } @@ -140,27 +140,27 @@ class VolumeTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/volume/$num/edit", $edit[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('HTTP 200: Edit | The new AWS Cloud Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Edit | The new AWS Cloud Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | Make sure w/o Warnings')); $this->assertText( - t('The AWS Cloud Volume "@name" has been saved.', ['@name' => $edit[$i]['name']]), - t('Confirm Message: Edit | The AWS Cloud Volume "@name" has been saved.', [ + $this->t('The AWS Cloud Volume "@name" has been saved.', ['@name' => $edit[$i]['name']]), + $this->t('Confirm Message: Edit | The AWS Cloud Volume "@name" has been saved.', [ '@name' => $edit[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($j = 0; $j < $i + 1; $j++) { $this->assertText($edit[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $edit[$i]['name'], ])); } @@ -172,29 +172,29 @@ class VolumeTest extends AwsCloudTestCase { $num = $i + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume/$num/delete"); - $this->assertResponse(200, t('Delete | HTTP 200: Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/volume/$num/delete", [], - t('Delete')); + $this->t('Delete')); - $this->assertResponse(200, t('Delete | HTTP 200: The Cloud Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); - $this->assertText($edit[$i]['name'], t('Delete | Name: @name', ['@name' => $edit[$i]['name']])); + $this->assertResponse(200, $this->t('Delete | HTTP 200: The Cloud Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); + $this->assertText($edit[$i]['name'], $this->t('Delete | Name: @name', ['@name' => $edit[$i]['name']])); $this->assertText( - t('The AWS Cloud Volume "@name" has been deleted.', ['@name' => $edit[$i]['name']]), - t('Confirm Message: Delete | The AWS Cloud Volume "@name" has been deleted.', [ + $this->t('The AWS Cloud Volume "@name" has been deleted.', ['@name' => $edit[$i]['name']]), + $this->t('Confirm Message: Delete | The AWS Cloud Volume "@name" has been deleted.', [ '@name' => $edit[$i]['name'], ]) ); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('Delete | HTTP 200: Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Delete | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Delete | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Delete | HTTP 200: Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Delete | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Delete | Make sure w/o Warnings')); } } @@ -227,23 +227,23 @@ class VolumeTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Volumes.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Volumes.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -254,24 +254,24 @@ class VolumeTest extends AwsCloudTestCase { $num = $i + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/edit"); - $this->assertLink(t('Attach')); + $this->assertLink($this->t('Attach')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/attach"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/delete"); - $this->assertLink(t('List AWS Cloud Volumes')); + $this->assertLink($this->t('List AWS Cloud Volumes')); // Click 'Refresh'. - $this->clickLink(t('List AWS Cloud Volumes')); - $this->assertResponse(200, t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->clickLink($this->t('List AWS Cloud Volumes')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume/$num/edit"); $this->assertNoLink('Edit'); - $this->assertLink(t('Attach')); + $this->assertLink($this->t('Attach')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/attach"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/delete"); } @@ -293,23 +293,23 @@ class VolumeTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Volumes.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Volumes.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -320,11 +320,11 @@ class VolumeTest extends AwsCloudTestCase { $num = $i + self::AWS_CLOUD_VOLUME_REPEAT_COUNT + 1; $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume/$num"); - $this->assertLink(t('Edit')); + $this->assertLink($this->t('Edit')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/edit"); - $this->assertLink(t('Detach')); + $this->assertLink($this->t('Detach')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/detach"); - $this->assertLink(t('Delete')); + $this->assertLink($this->t('Delete')); $this->assertLinkByHref("/clouds/aws_cloud/$cloud_context/volume/$num/delete"); } @@ -345,7 +345,7 @@ class VolumeTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertLink($add[$i]['tags_name']); @@ -367,7 +367,7 @@ class VolumeTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -391,7 +391,7 @@ class VolumeTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertNoLink($add[$i]['tags_name']); @@ -405,23 +405,23 @@ class VolumeTest extends AwsCloudTestCase { // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num + 1])); - $this->assertNoText(t('Notice'), t('Edit | List | Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Edit | List | Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('Edit | List | HTTP 200: Volume #@num', ['@num' => $num + 1])); + $this->assertNoText($this->t('Notice'), $this->t('Edit | List | Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Edit | List | Make sure w/o Warnings')); for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } // Click 'Refresh'. - $this->clickLink(t('Refresh')); - $this->assertText(t('Updated Volumes.')); + $this->clickLink($this->t('Refresh')); + $this->assertText($this->t('Updated Volumes.')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VOLUME_REPEAT_COUNT; $i++) { $this->assertNoText($add[$i]['name'], - t('Edit | List | Make sure w/ Listing: @name', [ + $this->t('Edit | List | Make sure w/ Listing: @name', [ '@name' => $add[$i]['name'], ])); } @@ -457,13 +457,13 @@ class VolumeTest extends AwsCloudTestCase { $this->drupalPostForm("/clouds/aws_cloud/$cloud_context/volume/add", $add[$i], - t('Save')); + $this->t('Save')); $this->assertResponse(200); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/volume"); - $this->assertResponse(200, t('HTTP 200: List | Volume #@num', ['@num' => $num])); - $this->assertText(t('Create Snapshot')); + $this->assertResponse(200, $this->t('HTTP 200: List | Volume #@num', ['@num' => $num])); + $this->assertText($this->t('Create Snapshot')); // Add a volume to DescribeVolumes. $volume_id = $this->latestTemplateVars['volume_id']; @@ -471,11 +471,11 @@ class VolumeTest extends AwsCloudTestCase { $this->addVolumeMockData($add[$i]); // Click "Create Snapshot" link. - $this->clickLink(t('Create Snapshot'), $i); + $this->clickLink($this->t('Create Snapshot'), $i); // Make sure creating page. $this->assertResponse(200); - $this->assertText(t('Add AWS Cloud Snapshot')); + $this->assertText($this->t('Add AWS Cloud Snapshot')); // Make sure the default value of field volume_id. $this->assertSession()->fieldValueEquals('volume_id', $volume_id); diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/SubnetTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/SubnetTest.php index 02ad978b..187ea270 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/SubnetTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/SubnetTest.php @@ -60,10 +60,10 @@ class SubnetTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/subnet/add", $add[$i], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The AWS Cloud Subnet "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The AWS Cloud Subnet "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/subnet"); @@ -85,7 +85,7 @@ class SubnetTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/subnet/$num/edit", $edit[$i], - t('Save') + $this->t('Save') ); $this->assertResponse(200); $this->assertText(t( @@ -115,7 +115,7 @@ class SubnetTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SUBNET_REPEAT_COUNT; $i++) { $this->assertNoLink($edit[$i]['name']); @@ -139,7 +139,7 @@ class SubnetTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SUBNET_REPEAT_COUNT; $i++) { $this->assertNoLink($edit[$i]['name']); @@ -162,7 +162,7 @@ class SubnetTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_SUBNET_REPEAT_COUNT; $i++) { $this->assertLink($edit[$i]['name']); @@ -180,10 +180,10 @@ class SubnetTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/subnet/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The AWS Cloud Subnet "@name" has been deleted.', ['@name' => $edit[$i]['name']] )); diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/VpcTest.php b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/VpcTest.php index cc0a0c7f..a38df35d 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/VpcTest.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Functional/Vpc/VpcTest.php @@ -58,10 +58,10 @@ class VpcTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/vpc/add", $add[$i], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The AWS Cloud VPC "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The AWS Cloud VPC "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/aws_cloud/$cloud_context/vpc"); @@ -82,10 +82,10 @@ class VpcTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/vpc/$num/edit", $edit[$i], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The AWS Cloud VPC "@name" has been saved.', ['@name' => $edit[$i]['name']] )); @@ -112,7 +112,7 @@ class VpcTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VPC_REPEAT_COUNT; $i++) { $this->assertNoLink($edit[$i]['name']); @@ -136,7 +136,7 @@ class VpcTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VPC_REPEAT_COUNT; $i++) { $this->assertNoLink($edit[$i]['name']); @@ -159,7 +159,7 @@ class VpcTest extends AwsCloudTestCase { } // Click 'Refresh'. - $this->clickLink(t('Refresh')); + $this->clickLink($this->t('Refresh')); // Make sure listing. for ($i = 0; $i < self::AWS_CLOUD_VPC_REPEAT_COUNT; $i++) { $this->assertLink($edit[$i]['name']); @@ -177,10 +177,10 @@ class VpcTest extends AwsCloudTestCase { $this->drupalPostForm( "/clouds/aws_cloud/$cloud_context/vpc/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The AWS Cloud VPC "@name" has been deleted.', ['@name' => $edit[$i]['name']] )); diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestEntityTrait.php b/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestEntityTrait.php index c42cf0a8..78a7dd83 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestEntityTrait.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestEntityTrait.php @@ -482,7 +482,7 @@ trait AwsCloudTestEntityTrait { $this->drupalPostForm( "$path_prefix$cloud_context/$entity_type_name", $data, - t('Apply to selected items') + $this->t('Apply to selected items') ); $this->assertResponse(200); @@ -512,7 +512,7 @@ trait AwsCloudTestEntityTrait { foreach ($entities_data as $entity_data) { $this->assertText( - t('The @type "@label" has been @operation_passive.', [ + $this->t('The @type "@label" has been @operation_passive.', [ '@type' => $entity_data->getEntityType()->getLabel(), '@label' => $entity_data->label(), '@operation_passive' => $operation_passive, @@ -522,11 +522,11 @@ trait AwsCloudTestEntityTrait { $operation_passive_upper = ucfirst($operation_passive); $message = \Drupal::translation()->formatPlural($entity_count, - t('@operation_passive_upper @entity_count item.', [ + $this->t('@operation_passive_upper @entity_count item.', [ '@operation_passive_upper' => $operation_passive_upper, '@entity_count' => $entity_count, ]), - t('@operation_passive_upper @entity_count items.', [ + $this->t('@operation_passive_upper @entity_count items.', [ '@operation_passive_upper' => $operation_passive_upper, '@entity_count' => $entity_count, ]) diff --git a/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestFormDataTrait.php b/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestFormDataTrait.php index 76e5f439..e1c63705 100644 --- a/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestFormDataTrait.php +++ b/modules/cloud_service_providers/aws_cloud/tests/src/Traits/AwsCloudTestFormDataTrait.php @@ -736,7 +736,7 @@ trait AwsCloudTestFormDataTrait { $rules_added[] = $rule; $this->updateRulesMockData($rules_added, self::$awsCloudSecurityGroupRulesOutbound); - $this->drupalPostForm($edit_url, $params, t('Save')); + $this->drupalPostForm($edit_url, $params, $this->t('Save')); $this->assertText($rule['from_port'], 'Create Rule'); } @@ -778,7 +778,7 @@ trait AwsCloudTestFormDataTrait { $this->assertText($rule['from_port'], 'Revoke Rule'); $this->updateRulesMockData($rules, self::$awsCloudSecurityGroupRulesOutbound); - $this->submitForm([], t('Revoke')); + $this->submitForm([], $this->t('Revoke')); $this->assertText('Permission revoked', 'Revoke Rule'); } } diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sConfigMapViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sConfigMapViewBuilder.php index 4abd7661..3cf87d77 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sConfigMapViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sConfigMapViewBuilder.php @@ -16,7 +16,7 @@ class K8sConfigMapViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'config_map', - 'title' => t('Config Map'), + 'title' => $this->t('Config Map'), 'open' => TRUE, 'fields' => [ 'name', @@ -28,7 +28,7 @@ class K8sConfigMapViewBuilder extends CloudViewBuilder { ], [ 'name' => 'config_map_data', - 'title' => t('Data'), + 'title' => $this->t('Data'), 'open' => TRUE, 'fields' => [ 'data', @@ -36,7 +36,7 @@ class K8sConfigMapViewBuilder extends CloudViewBuilder { ], [ 'name' => 'config_map_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -44,7 +44,7 @@ class K8sConfigMapViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sCronJobViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sCronJobViewBuilder.php index 63b15454..017ee5aa 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sCronJobViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sCronJobViewBuilder.php @@ -16,7 +16,7 @@ class K8sCronJobViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'cron_job', - 'title' => t('Cron Job'), + 'title' => $this->t('Cron Job'), 'open' => TRUE, 'fields' => [ 'name', @@ -33,7 +33,7 @@ class K8sCronJobViewBuilder extends CloudViewBuilder { ], [ 'name' => 'cron_job_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -41,7 +41,7 @@ class K8sCronJobViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sDeploymentViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sDeploymentViewBuilder.php index ca14ce10..1cada965 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sDeploymentViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sDeploymentViewBuilder.php @@ -16,7 +16,7 @@ class K8sDeploymentViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'deployment', - 'title' => t('Deployment'), + 'title' => $this->t('Deployment'), 'open' => TRUE, 'fields' => [ 'name', @@ -31,7 +31,7 @@ class K8sDeploymentViewBuilder extends CloudViewBuilder { ], [ 'name' => 'status', - 'title' => t('Status'), + 'title' => $this->t('Status'), 'open' => TRUE, 'fields' => [ 'available_replicas', @@ -45,7 +45,7 @@ class K8sDeploymentViewBuilder extends CloudViewBuilder { ], [ 'name' => 'deployment_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -54,7 +54,7 @@ class K8sDeploymentViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sJobViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sJobViewBuilder.php index aeb29c4b..d2254d6c 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sJobViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sJobViewBuilder.php @@ -16,7 +16,7 @@ class K8sJobViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'job', - 'title' => t('Job'), + 'title' => $this->t('Job'), 'open' => TRUE, 'fields' => [ 'name', @@ -31,7 +31,7 @@ class K8sJobViewBuilder extends CloudViewBuilder { ], [ 'name' => 'pod_status', - 'title' => t('Pod Status'), + 'title' => $this->t('Pod Status'), 'open' => TRUE, 'fields' => [ 'active', @@ -41,7 +41,7 @@ class K8sJobViewBuilder extends CloudViewBuilder { ], [ 'name' => 'job_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -49,7 +49,7 @@ class K8sJobViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sLimitRangeViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sLimitRangeViewBuilder.php index 90dc4429..7121eaca 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sLimitRangeViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sLimitRangeViewBuilder.php @@ -16,7 +16,7 @@ class K8sLimitRangeViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'limit_range', - 'title' => t('Limit Range'), + 'title' => $this->t('Limit Range'), 'open' => TRUE, 'fields' => [ 'name', @@ -29,7 +29,7 @@ class K8sLimitRangeViewBuilder extends CloudViewBuilder { ], [ 'name' => 'limit_range_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -37,7 +37,7 @@ class K8sLimitRangeViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sNamespaceViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sNamespaceViewBuilder.php index be7abf08..f848f8b7 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sNamespaceViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sNamespaceViewBuilder.php @@ -16,7 +16,7 @@ class K8sNamespaceViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'namespace', - 'title' => t('Namespace'), + 'title' => $this->t('Namespace'), 'open' => TRUE, 'fields' => [ 'name', @@ -27,7 +27,7 @@ class K8sNamespaceViewBuilder extends CloudViewBuilder { ], [ 'name' => 'namespace_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -35,7 +35,7 @@ class K8sNamespaceViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sNetworkPolicyViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sNetworkPolicyViewBuilder.php index 01dab2dd..e892cd7e 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sNetworkPolicyViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sNetworkPolicyViewBuilder.php @@ -16,7 +16,7 @@ class K8sNetworkPolicyViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'network_policy', - 'title' => t('Network Policy'), + 'title' => $this->t('Network Policy'), 'open' => TRUE, 'fields' => [ 'name', @@ -32,7 +32,7 @@ class K8sNetworkPolicyViewBuilder extends CloudViewBuilder { ], [ 'name' => 'network_policy_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -41,7 +41,7 @@ class K8sNetworkPolicyViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sNodeViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sNodeViewBuilder.php index e728502e..91c75475 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sNodeViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sNodeViewBuilder.php @@ -72,25 +72,25 @@ class K8sNodeViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'node_allocated_resources', - 'title' => t('Allocated Resources'), + 'title' => $this->t('Allocated Resources'), 'open' => TRUE, 'fields' => [], ], [ 'name' => 'node_heatmap', - 'title' => t('Heatmap'), + 'title' => $this->t('Heatmap'), 'open' => TRUE, 'fields' => [], ], [ 'name' => 'entity_metrics', - 'title' => t('Metrics'), + 'title' => $this->t('Metrics'), 'open' => TRUE, 'fields' => [], ], [ 'name' => 'node', - 'title' => t('Node'), + 'title' => $this->t('Node'), 'open' => TRUE, 'fields' => [ 'name', @@ -106,7 +106,7 @@ class K8sNodeViewBuilder extends CloudViewBuilder { ], [ 'name' => 'system_info', - 'title' => t('System Info'), + 'title' => $this->t('System Info'), 'open' => TRUE, 'fields' => [ 'machine_id', @@ -123,7 +123,7 @@ class K8sNodeViewBuilder extends CloudViewBuilder { ], [ 'name' => 'metrics', - 'title' => t('Metrics'), + 'title' => $this->t('Metrics'), 'open' => TRUE, 'fields' => [ 'cpu_capacity', @@ -140,25 +140,25 @@ class K8sNodeViewBuilder extends CloudViewBuilder { ], [ 'name' => 'costs', - 'title' => t('Costs'), + 'title' => $this->t('Costs'), 'open' => TRUE, 'fields' => [], ], [ 'name' => 'node_conditions', - 'title' => t('Conditions'), + 'title' => $this->t('Conditions'), 'open' => TRUE, 'fields' => [], ], [ 'name' => 'node_pods', - 'title' => t('Pods'), + 'title' => $this->t('Pods'), 'open' => TRUE, 'fields' => [], ], [ 'name' => 'node_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -166,7 +166,7 @@ class K8sNodeViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sPodViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sPodViewBuilder.php index 7a478fd7..0d841125 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sPodViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sPodViewBuilder.php @@ -16,13 +16,13 @@ class K8sPodViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'entity_metrics', - 'title' => t('Metrics'), + 'title' => $this->t('Metrics'), 'open' => TRUE, 'fields' => [], ], [ 'name' => 'pod', - 'title' => t('Pod'), + 'title' => $this->t('Pod'), 'open' => TRUE, 'fields' => [ 'name', @@ -38,7 +38,7 @@ class K8sPodViewBuilder extends CloudViewBuilder { ], [ 'name' => 'metrics', - 'title' => t('Metrics'), + 'title' => $this->t('Metrics'), 'open' => TRUE, 'fields' => [ 'cpu_request', @@ -51,7 +51,7 @@ class K8sPodViewBuilder extends CloudViewBuilder { ], [ 'name' => 'pod_containers', - 'title' => t('Containers'), + 'title' => $this->t('Containers'), 'open' => FALSE, 'fields' => [ 'containers', @@ -59,7 +59,7 @@ class K8sPodViewBuilder extends CloudViewBuilder { ], [ 'name' => 'pod_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -68,7 +68,7 @@ class K8sPodViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sReplicaSetViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sReplicaSetViewBuilder.php index 7c76a80f..395f86aa 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sReplicaSetViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sReplicaSetViewBuilder.php @@ -16,7 +16,7 @@ class K8sReplicaSetViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'replica_set', - 'title' => t('ReplicaSet'), + 'title' => $this->t('ReplicaSet'), 'open' => TRUE, 'fields' => [ 'name', @@ -30,7 +30,7 @@ class K8sReplicaSetViewBuilder extends CloudViewBuilder { ], [ 'name' => 'status', - 'title' => t('Status'), + 'title' => $this->t('Status'), 'open' => TRUE, 'fields' => [ 'conditions', @@ -42,7 +42,7 @@ class K8sReplicaSetViewBuilder extends CloudViewBuilder { ], [ 'name' => 'replica_set_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -50,7 +50,7 @@ class K8sReplicaSetViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sResourceQuotaViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sResourceQuotaViewBuilder.php index 2d25a228..90d4d9b3 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sResourceQuotaViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sResourceQuotaViewBuilder.php @@ -16,7 +16,7 @@ class K8sResourceQuotaViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'resource_quota', - 'title' => t('Resource Quota'), + 'title' => $this->t('Resource Quota'), 'open' => TRUE, 'fields' => [ 'name', @@ -28,7 +28,7 @@ class K8sResourceQuotaViewBuilder extends CloudViewBuilder { ], [ 'name' => 'status', - 'title' => t('Status'), + 'title' => $this->t('Status'), 'open' => TRUE, 'fields' => [ 'status_hard', @@ -37,7 +37,7 @@ class K8sResourceQuotaViewBuilder extends CloudViewBuilder { ], [ 'name' => 'resource_quota_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -45,7 +45,7 @@ class K8sResourceQuotaViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sRoleViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sRoleViewBuilder.php index e518e30f..d5b3ba1c 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sRoleViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sRoleViewBuilder.php @@ -16,7 +16,7 @@ class K8sRoleViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'role', - 'title' => t('Role'), + 'title' => $this->t('Role'), 'open' => TRUE, 'fields' => [ 'name', @@ -29,7 +29,7 @@ class K8sRoleViewBuilder extends CloudViewBuilder { ], [ 'name' => 'role_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -37,7 +37,7 @@ class K8sRoleViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sSecretViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sSecretViewBuilder.php index 275c69c0..c116138b 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sSecretViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sSecretViewBuilder.php @@ -16,7 +16,7 @@ class K8sSecretViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'secret', - 'title' => t('Secret'), + 'title' => $this->t('Secret'), 'open' => TRUE, 'fields' => [ 'name', @@ -29,7 +29,7 @@ class K8sSecretViewBuilder extends CloudViewBuilder { ], [ 'name' => 'secret_data', - 'title' => t('Data'), + 'title' => $this->t('Data'), 'open' => TRUE, 'fields' => [ 'data', @@ -37,7 +37,7 @@ class K8sSecretViewBuilder extends CloudViewBuilder { ], [ 'name' => 'secret_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -45,7 +45,7 @@ class K8sSecretViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Entity/K8sServiceViewBuilder.php b/modules/cloud_service_providers/k8s/src/Entity/K8sServiceViewBuilder.php index e8ca3467..5410f7e5 100644 --- a/modules/cloud_service_providers/k8s/src/Entity/K8sServiceViewBuilder.php +++ b/modules/cloud_service_providers/k8s/src/Entity/K8sServiceViewBuilder.php @@ -16,7 +16,7 @@ class K8sServiceViewBuilder extends CloudViewBuilder { return [ [ 'name' => 'service', - 'title' => t('Service'), + 'title' => $this->t('Service'), 'open' => TRUE, 'fields' => [ 'name', @@ -34,7 +34,7 @@ class K8sServiceViewBuilder extends CloudViewBuilder { ], [ 'name' => 'service_detail', - 'title' => t('Detail'), + 'title' => $this->t('Detail'), 'open' => FALSE, 'fields' => [ 'detail', @@ -42,7 +42,7 @@ class K8sServiceViewBuilder extends CloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeAllocatedResourcesBlock.php b/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeAllocatedResourcesBlock.php index 06e09ed1..36a6f1da 100644 --- a/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeAllocatedResourcesBlock.php +++ b/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeAllocatedResourcesBlock.php @@ -196,7 +196,7 @@ class K8sNodeAllocatedResourcesBlock extends BlockBase implements ContainerFacto $fieldset_defs = [ [ 'name' => 'k8s_allocated_resources', - 'title' => t('Allocated Resources'), + 'title' => $this->t('Allocated Resources'), 'open' => TRUE, 'fields' => [ 'k8s_node_allocated_resources', diff --git a/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeCostsBlock.php b/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeCostsBlock.php index b91e7a5b..a56f78db 100644 --- a/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeCostsBlock.php +++ b/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeCostsBlock.php @@ -189,7 +189,7 @@ class K8sNodeCostsBlock extends BlockBase implements ContainerFactoryPluginInter $fieldset_defs = [ [ 'name' => 'k8s_costs', - 'title' => t('Costs'), + 'title' => $this->t('Costs'), 'open' => TRUE, 'fields' => [ 'k8s_node_costs', diff --git a/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeHeatmapBlock.php b/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeHeatmapBlock.php index bb97c245..386fc7d1 100644 --- a/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeHeatmapBlock.php +++ b/modules/cloud_service_providers/k8s/src/Plugin/Block/K8sNodeHeatmapBlock.php @@ -184,7 +184,7 @@ class K8sNodeHeatmapBlock extends BlockBase implements ContainerFactoryPluginInt $fieldset_defs = [ [ 'name' => 'k8s_heatmap', - 'title' => t('Heatmap'), + 'title' => $this->t('Heatmap'), 'open' => TRUE, 'fields' => [ 'k8s_node_heatmap', diff --git a/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/KeyValue.php b/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/KeyValue.php index 06e27d04..cd6edc68 100644 --- a/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/KeyValue.php +++ b/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/KeyValue.php @@ -84,20 +84,20 @@ class KeyValue extends FieldItemBase { $elements['max_length'] = [ '#type' => 'number', - '#title' => t('Maximum length'), + '#title' => $this->t('Maximum length'), '#default_value' => $this->getSetting('max_length'), '#required' => TRUE, - '#description' => t('The maximum length of the field in characters.'), + '#description' => $this->t('The maximum length of the field in characters.'), '#min' => 1, '#disabled' => $has_data, ]; $elements['long'] = [ '#type' => 'checkbox', - '#title' => t('Long'), + '#title' => $this->t('Long'), '#default_value' => $this->getSetting('long'), '#required' => TRUE, - '#description' => t('The content is long or short.'), + '#description' => $this->t('The content is long or short.'), '#disabled' => $has_data, ]; diff --git a/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Limit.php b/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Limit.php index 46b5a347..90a7eb0f 100644 --- a/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Limit.php +++ b/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Limit.php @@ -116,10 +116,10 @@ class Limit extends FieldItemBase { $elements['max_length'] = [ '#type' => 'number', - '#title' => t('Maximum length'), + '#title' => $this->t('Maximum length'), '#default_value' => $this->getSetting('max_length'), '#required' => TRUE, - '#description' => t('The maximum length of the field in characters.'), + '#description' => $this->t('The maximum length of the field in characters.'), '#min' => 1, '#disabled' => $has_data, ]; diff --git a/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Rule.php b/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Rule.php index 3a54101e..0ce244b4 100644 --- a/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Rule.php +++ b/modules/cloud_service_providers/k8s/src/Plugin/Field/FieldType/Rule.php @@ -92,10 +92,10 @@ class Rule extends FieldItemBase { $elements['max_length'] = [ '#type' => 'number', - '#title' => t('Maximum length'), + '#title' => $this->t('Maximum length'), '#default_value' => $this->getSetting('max_length'), '#required' => TRUE, - '#description' => t('The maximum length of the field in characters.'), + '#description' => $this->t('The maximum length of the field in characters.'), '#min' => 1, '#disabled' => $has_data, ]; diff --git a/modules/cloud_service_providers/k8s/src/Plugin/cloud/server_template/K8sCloudServerTemplatePlugin.php b/modules/cloud_service_providers/k8s/src/Plugin/cloud/server_template/K8sCloudServerTemplatePlugin.php index 531ed91a..e202aa95 100644 --- a/modules/cloud_service_providers/k8s/src/Plugin/cloud/server_template/K8sCloudServerTemplatePlugin.php +++ b/modules/cloud_service_providers/k8s/src/Plugin/cloud/server_template/K8sCloudServerTemplatePlugin.php @@ -204,12 +204,12 @@ class K8sCloudServerTemplatePlugin extends PluginBase implements CloudServerTemp public function buildListHeader() { return [ [ - 'data' => t('Namespace'), + 'data' => $this->t('Namespace'), 'specifier' => 'field_namespace', 'field' => 'field_namespace', ], [ - 'data' => t('Object'), + 'data' => $this->t('Object'), 'specifier' => 'field_object', 'field' => 'field_object', ], diff --git a/modules/cloud_service_providers/k8s/src/Service/K8sBatchOperations.php b/modules/cloud_service_providers/k8s/src/Service/K8sBatchOperations.php index 7a4551f8..5e2dcd6e 100644 --- a/modules/cloud_service_providers/k8s/src/Service/K8sBatchOperations.php +++ b/modules/cloud_service_providers/k8s/src/Service/K8sBatchOperations.php @@ -2,6 +2,7 @@ namespace Drupal\k8s\Service; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Entity\EntityInterface; use Drupal\Component\Serialization\Yaml; @@ -26,6 +27,8 @@ use Drupal\k8s\Entity\K8sRole; */ class K8sBatchOperations { + use StringTranslationTrait; + /** * The finish callback function. * @@ -155,7 +158,7 @@ class K8sBatchOperations { $metrics_nodes = $k8s_service->getMetricsNodes(['metadata.name' => $name]); } catch (K8sServiceException $e) { - \Drupal::messenger()->addWarning(t('Unable to retrieve CPU and Memory usage of nodes. Please install Kubernetes Metrics Server to K8s.')); + \Drupal::messenger()->addWarning($this->t('Unable to retrieve CPU and Memory usage of nodes. Please install Kubernetes Metrics Server to K8s.')); } if (!empty($metrics_nodes)) { @@ -345,7 +348,7 @@ class K8sBatchOperations { $metrics_pods = $k8s_service->getMetricsPods(['metadata.name' => $name]); } catch (K8sServiceException $e) { - \Drupal::messenger()->addWarning(t('Unable to retrieve CPU and Memory usage of pods. Please install Kubernetes Metrics Server to K8s.')); + \Drupal::messenger()->addWarning($this->t('Unable to retrieve CPU and Memory usage of pods. Please install Kubernetes Metrics Server to K8s.')); } $cpu_usage = 0; $memory_usage = 0; diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/CloudServerTemplateTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/CloudServerTemplateTest.php index f62da0a6..34e74fda 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/CloudServerTemplateTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/CloudServerTemplateTest.php @@ -87,16 +87,16 @@ class CloudServerTemplateTest extends K8sTestCase { $this->drupalPostForm( "/clouds/design/server_template/$cloud_context/k8s/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('HTTP 200: Add | The new cloud server template Form #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Add | The new cloud server template Form #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Created the @name cloud server template', [ + $this->t('Created the @name cloud server template', [ '@name' => $add[$i]['name[0][value]'], ]), - t('Confirm Message: Created the @name cloud server template.', [ + $this->t('Confirm Message: Created the @name cloud server template.', [ '@name' => $add[$i]['name[0][value]'], ]) ); @@ -104,9 +104,9 @@ class CloudServerTemplateTest extends K8sTestCase { // List test. $this->drupalGet("/clouds/design/server_template/$cloud_context"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server template')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server template')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Edit test. $pods = $this->createPodTestFormData(self::CLOUD_SERVER_TEMPLATES_REPEAT_COUNT, $this->namespace); @@ -123,19 +123,19 @@ class CloudServerTemplateTest extends K8sTestCase { $this->drupalPostForm( $this->getUrl(), $edit[$i], - t('Save') + $this->t('Save') ); - $this->assertResponse(200, t('HTTP 200: Edit | The new cloud server template #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Edit | The new cloud server template #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Saved the @name cloud server template.', + $this->t('Saved the @name cloud server template.', [ '@name' => $edit[$i]['name[0][value]'], ] ), - t('Confirm Message: Saved the @name cloud server template.', + $this->t('Confirm Message: Saved the @name cloud server template.', [ '@name' => $edit[$i]['name[0][value]'], ] @@ -155,20 +155,20 @@ class CloudServerTemplateTest extends K8sTestCase { $this->drupalPostForm( $this->getUrl(), [], - t('Delete')); - $this->assertResponse(200, t('HTTP 200: Delete | Cloud server template #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('warning'), t('Make sure w/o Warnings')); + $this->t('Delete')); + $this->assertResponse(200, $this->t('HTTP 200: Delete | Cloud server template #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('warning'), $this->t('Make sure w/o Warnings')); } // Make sure the deleted templates are not listed anymore. $this->drupalGet("/clouds/design/server_template/$cloud_context"); - $this->assertResponse(200, t('HTTP 200: List | Cloud server te#@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | Cloud server te#@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); for ($j = 0; $j < self::CLOUD_SERVER_TEMPLATES_REPEAT_COUNT; $j++) { $this->assertNoText($edit[$j]['name[0][value]'], - t("Make sure w/ Listing @num: @name", [ + $this->t("Make sure w/ Listing @num: @name", [ '@num' => $j + 1, '@name' => $edit[$j]['name[0][value]'], ])); @@ -207,16 +207,16 @@ class CloudServerTemplateTest extends K8sTestCase { $this->drupalPostForm( "/clouds/design/server_template/$cloud_context/k8s/add", $add[$i], - t('Save')); + $this->t('Save')); - $this->assertResponse(200, t('HTTP 200: Add | The new cloud server template Form #@num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Add | The new cloud server template Form #@num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('Created the @name cloud server template', [ + $this->t('Created the @name cloud server template', [ '@name' => $add[$i]['name[0][value]'], ]), - t('Confirm Message: Created the @name cloud server template.', [ + $this->t('Confirm Message: Created the @name cloud server template.', [ '@name' => $add[$i]['name[0][value]'], ]) ); @@ -249,20 +249,20 @@ class CloudServerTemplateTest extends K8sTestCase { $this->drupalPostForm( $this->getUrl(), [], - t('Launch') + $this->t('Launch') ); - $this->assertResponse(200, t('HTTP 200 for @num', ['@num' => $num])); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200 for @num', ['@num' => $num])); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertText( - t('@object @name launched.', + $this->t('@object @name launched.', [ '@object' => ucfirst($object), '@name' => $add[$i]['name[0][value]'], ] ), - t('@object launched', ['@object' => ucfirst($object)]) + $this->t('@object launched', ['@object' => ucfirst($object)]) ); } diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/Config/K8sCloudConfigTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/Config/K8sCloudConfigTest.php index 45083db9..08e66016 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/Config/K8sCloudConfigTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/Config/K8sCloudConfigTest.php @@ -48,9 +48,9 @@ class K8sCloudConfigTest extends K8sTestCase { // List k8s. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this>$this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Add a new Config information. $add = $this->createCloudConfigTestFormData(self::K8S_CLOUD_CONFIG_REPEAT_COUNT); @@ -58,33 +58,33 @@ class K8sCloudConfigTest extends K8sTestCase { unset($add[$i]['cloud_context']); $this->drupalGet('/admin/structure/cloud_config/add'); - $this->assertResponse(200, t('HTTP 200: Add | K8s cloud service provider form')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Add | K8s cloud service provider form')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Test if API server field is empty. $_add = $add; $_add[$i]['field_api_server[0][value]'] = ''; $this->drupalPostForm('/admin/structure/cloud_config/add', $_add[$i], - t('Save') + $this->t('Save') ); - $this->assertResponse(200, t('HTTP 200: Not saved | K8s cloud service provider form')); - $this->assertText(t('Error'), t('Make sure w/ Error')); - $this->assertText(t('The API server field cannot be empty.')); + $this->assertResponse(200, $this->t('HTTP 200: Not saved | K8s cloud service provider form')); + $this->assertText($this->t('Error'), $this->t('Make sure w/ Error')); + $this->assertText($this->t('The API server field cannot be empty.')); // Test if API server field is empty. $_add = $add; $_add[$i]['field_token[0][value]'] = ''; $this->drupalPostForm('/admin/structure/cloud_config/add', $_add[$i], - t('Save') + $this->t('Save') ); - $this->assertResponse(200, t('HTTP 200: Not saved | K8s cloud service provider form')); - $this->assertText(t('Error'), t('Make sure w/ Error')); - $this->assertText(t('The token field cannot be empty.')); + $this->assertResponse(200, $this->t('HTTP 200: Not saved | K8s cloud service provider form')); + $this->assertText($this->t('Error'), $this->t('Make sure w/ Error')); + $this->assertText($this->t('The token field cannot be empty.')); // Test if both API server field and Token field are empty. $_add = $add; @@ -92,46 +92,46 @@ class K8sCloudConfigTest extends K8sTestCase { $_add[$i]['field_token[0][value]'] = ''; $this->drupalPostForm('/admin/structure/cloud_config/add', $_add[$i], - t('Save') + $this->t('Save') ); - $this->assertResponse(200, t('HTTP 200: Not saved | K8s cloud service provider form')); - $this->assertText(t('Error'), t('Make sure w/ Error')); - $this->assertText(t('The API server field cannot be empty.')); - $this->assertText(t('The token field cannot be empty.')); + $this->assertResponse(200, $this->t('HTTP 200: Not saved | K8s cloud service provider form')); + $this->assertText($this->t('Error'), $this->t('Make sure w/ Error')); + $this->assertText($this->t('The API server field cannot be empty.')); + $this->assertText($this->t('The token field cannot be empty.')); // Test the normal "Save" case. $this->drupalPostForm('/admin/structure/cloud_config/add', $add[$i], - t('Save') + $this->t('Save') ); - $this->assertResponse(200, t('HTTP 200: Saved | K8s cloud service provider form')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); - $this->assertText(t('Created the cloud service provider: @label.', + $this->assertResponse(200, $this->t('HTTP 200: Saved | K8s cloud service provider form')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); + $this->assertText($this->t('Created the cloud service provider: @label.', ['@label' => $add[$i]['name[0][value]']] )); // Make sure listing for '/admin/structure/cloud_config'. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertLink($add[$i]['name[0][value]']); // Make sure listing for '/clouds'. $this->drupalGet('/clouds'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertLink($add[$i]['name[0][value]']); // Make sure listing for '/admin/config/services/cloud/k8s'. $this->drupalGet('/admin/config/services/cloud/k8s'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertLink($add[$i]['name[0][value]']); } @@ -144,31 +144,31 @@ class K8sCloudConfigTest extends K8sTestCase { $this->drupalPostForm("/admin/structure/cloud_config/${num}/edit", $edit[$i], - t('Save') + $this->t('Save') ); - $this->assertResponse(200, t('HTTP 200: Edit | K8s Form')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: Edit | K8s Form')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); // Make sure listing for '/admin/structure/cloud_config'. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertLink($edit[$i]['name[0][value]']); // Make sure listing for '/clouds'. $this->drupalGet('/clouds'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertLink($edit[$i]['name[0][value]']); // Make sure listing for '/admin/config/services/cloud/k8s'. $this->drupalGet('/admin/config/services/cloud/k8s'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertLink($edit[$i]['name[0][value]']); } @@ -178,13 +178,13 @@ class K8sCloudConfigTest extends K8sTestCase { $this->drupalPostForm("/admin/structure/cloud_config/${num}/delete", [], - t('Delete') + $this->t('Delete') ); - $this->assertResponse(200, t('HTTP 200: Delete | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); - $this->assertText(t('The cloud service provider @label has been deleted.', + $this->assertResponse(200, $this->t('HTTP 200: Delete | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); + $this->assertText($this->t('The cloud service provider @label has been deleted.', ['@label' => $edit[$i]['name[0][value]']] )); @@ -194,23 +194,23 @@ class K8sCloudConfigTest extends K8sTestCase { // Make sure listing for '/admin/structure/cloud_config'. $this->drupalGet('/admin/structure/cloud_config'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertNoLink($edit[$k]['name[0][value]']); // Make sure listing for '/clouds'. $this->drupalGet('/clouds'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertNoLink($edit[$k]['name[0][value]']); // Make sure listing for '/admin/config/services/cloud/k8s'. $this->drupalGet('/admin/config/services/cloud/k8s'); - $this->assertResponse(200, t('HTTP 200: List | K8s')); - $this->assertNoText(t('Notice'), t('Make sure w/o Notice')); - $this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); + $this->assertResponse(200, $this->t('HTTP 200: List | K8s')); + $this->assertNoText($this->t('Notice'), $this->t('Make sure w/o Notice')); + $this->assertNoText($this->t('Warning'), $this->t('Make sure w/o Warnings')); $this->assertNoLink($edit[$k]['name[0][value]']); } } diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/Form/K8sCreateProjectFormTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/Form/K8sCreateProjectFormTest.php index 413a4f01..fdeb6634 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/Form/K8sCreateProjectFormTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/Form/K8sCreateProjectFormTest.php @@ -47,10 +47,10 @@ class K8sCreateProjectFormTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/namespace/create_project", $add[$i], - t('Create') + $this->t('Create') ); $this->assertResponse(200); - $this->assertText(t('The project "@name" has been created.', ['@name' => $add[$i]['project_name']])); + $this->assertText($this->t('The project "@name" has been created.', ['@name' => $add[$i]['project_name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/namespace"); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sConfigMapTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sConfigMapTest.php index 4b7553ed..69595368 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sConfigMapTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sConfigMapTest.php @@ -51,10 +51,10 @@ class K8sConfigMapTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/config_map/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Config Map "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Config Map "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/config_map"); @@ -72,10 +72,10 @@ class K8sConfigMapTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/config_map/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Config Map "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sConfigMapTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/config_map/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Config Map "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sCronJobTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sCronJobTest.php index 25b7685f..137c1d54 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sCronJobTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sCronJobTest.php @@ -51,10 +51,10 @@ class K8sCronJobTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/cron_job/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Cron Job "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Cron Job "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/cron_job"); @@ -72,10 +72,10 @@ class K8sCronJobTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/cron_job/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Cron Job "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sCronJobTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/cron_job/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Cron Job "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sDeploymentTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sDeploymentTest.php index 13d373d7..3d825652 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sDeploymentTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sDeploymentTest.php @@ -51,10 +51,10 @@ class K8sDeploymentTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/deployment/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Deployment "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Deployment "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/deployment"); @@ -72,10 +72,10 @@ class K8sDeploymentTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/deployment/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Deployment "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sDeploymentTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/deployment/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Deployment "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sJobTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sJobTest.php index 420622af..7584d846 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sJobTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sJobTest.php @@ -51,10 +51,10 @@ class K8sJobTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/job/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Job "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Job "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/job"); @@ -72,10 +72,10 @@ class K8sJobTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/job/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Job "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sJobTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/job/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Job "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sLimitRangeTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sLimitRangeTest.php index 3c544047..cdd2a02a 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sLimitRangeTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sLimitRangeTest.php @@ -51,10 +51,10 @@ class K8sLimitRangeTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/limit_range/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Limit Range "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Limit Range "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/limit_range"); @@ -72,10 +72,10 @@ class K8sLimitRangeTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/limit_range/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Limit Range "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sLimitRangeTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/limit_range/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Limit Range "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNamespaceTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNamespaceTest.php index 857ab952..7d87fbcf 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNamespaceTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNamespaceTest.php @@ -46,10 +46,10 @@ class K8sNamespaceTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/namespace/add", $add[$i], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Namespace "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Namespace "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/namespace"); @@ -67,10 +67,10 @@ class K8sNamespaceTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/namespace/$num/edit", $edit[$i], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Namespace "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -94,10 +94,10 @@ class K8sNamespaceTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/namespace/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Namespace "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNetworkPolicyTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNetworkPolicyTest.php index 70d4b9b4..67dec2c4 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNetworkPolicyTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sNetworkPolicyTest.php @@ -50,10 +50,10 @@ class K8sNetworkPolicyTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/network_policy/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Network Policy "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Network Policy "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/network_policy"); @@ -71,10 +71,10 @@ class K8sNetworkPolicyTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/network_policy/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Network Policy "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -89,10 +89,10 @@ class K8sNetworkPolicyTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/network_policy/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Network Policy "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sPodTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sPodTest.php index 7262c6b0..4f7882d8 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sPodTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sPodTest.php @@ -51,10 +51,10 @@ class K8sPodTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/pod/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Pod "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Pod "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/pod"); @@ -79,10 +79,10 @@ class K8sPodTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/pod/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Pod "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -97,10 +97,10 @@ class K8sPodTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/pod/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Pod "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sReplicaSetTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sReplicaSetTest.php index dcac95fb..9806014a 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sReplicaSetTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sReplicaSetTest.php @@ -51,10 +51,10 @@ class K8sReplicaSetTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/replica_set/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Replica Set "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Replica Set "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/replica_set"); @@ -72,10 +72,10 @@ class K8sReplicaSetTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/replica_set/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Replica Set "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sReplicaSetTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/replica_set/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Replica Set "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sResourceQuotaTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sResourceQuotaTest.php index 02ae4b7e..3b12833f 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sResourceQuotaTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sResourceQuotaTest.php @@ -51,10 +51,10 @@ class K8sResourceQuotaTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/resource_quota/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Resource Quota "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Resource Quota "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/resource_quota"); @@ -72,10 +72,10 @@ class K8sResourceQuotaTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/resource_quota/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Resource Quota "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sResourceQuotaTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/resource_quota/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Resource Quota "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sRoleTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sRoleTest.php index ef2c9338..d5d50479 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sRoleTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sRoleTest.php @@ -51,10 +51,10 @@ class K8sRoleTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/role/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Role "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Role "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/role"); @@ -72,10 +72,10 @@ class K8sRoleTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/role/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Role "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sRoleTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/role/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Role "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sSecretTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sSecretTest.php index 09eacab5..26d7e29e 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sSecretTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sSecretTest.php @@ -51,10 +51,10 @@ class K8sSecretTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/secret/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Secret "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Secret "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/secret"); @@ -72,10 +72,10 @@ class K8sSecretTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/secret/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Secret "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sSecretTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/secret/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Secret "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sServiceEntityTest.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sServiceEntityTest.php index 3caf980f..b6aeea23 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sServiceEntityTest.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sServiceEntityTest.php @@ -51,10 +51,10 @@ class K8sServiceEntityTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/service/add", $add[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t('The Kubernetes Service "@name" has been created.', ['@name' => $add[$i]['name']])); + $this->assertText($this->t('The Kubernetes Service "@name" has been created.', ['@name' => $add[$i]['name']])); // Make sure listing. $this->drupalGet("/clouds/k8s/$cloud_context/service"); @@ -72,10 +72,10 @@ class K8sServiceEntityTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/service/$num/edit", $edit[$i]['post_data'], - t('Save') + $this->t('Save') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Service "@name" has been saved.', ['@name' => $add[$i]['name']] )); @@ -90,10 +90,10 @@ class K8sServiceEntityTest extends K8sTestCase { $this->drupalPostForm( "/clouds/k8s/$cloud_context/service/$num/delete", [], - t('Delete') + $this->t('Delete') ); $this->assertResponse(200); - $this->assertText(t( + $this->assertText($this->t( 'The Kubernetes Service "@name" has been deleted.', ['@name' => $add[$i]['name']] )); diff --git a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sTestCase.php b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sTestCase.php index 78191a85..b597b202 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Functional/K8sTestCase.php +++ b/modules/cloud_service_providers/k8s/tests/src/Functional/K8sTestCase.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\k8s\Functional; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Component\Serialization\Yaml; use Drupal\Component\Utility\Random; use Drupal\Tests\BrowserTestBase; @@ -16,6 +17,7 @@ use Drupal\Tests\k8s\Traits\K8sTestEntityTrait; */ abstract class K8sTestCase extends BrowserTestBase { + use StringTranslationTrait; use K8sTestFormDataTrait; use K8sTestMockTrait; use K8sTestEntityTrait; diff --git a/modules/cloud_service_providers/k8s/tests/src/Traits/K8sTestEntityTrait.php b/modules/cloud_service_providers/k8s/tests/src/Traits/K8sTestEntityTrait.php index 808409c7..ffb56e18 100644 --- a/modules/cloud_service_providers/k8s/tests/src/Traits/K8sTestEntityTrait.php +++ b/modules/cloud_service_providers/k8s/tests/src/Traits/K8sTestEntityTrait.php @@ -66,7 +66,7 @@ trait K8sTestEntityTrait { $this->drupalPostForm( "$path_prefix$cloud_context/$entity_type_name", $data, - t('Apply to selected items') + $this->t('Apply to selected items') ); $this->assertResponse(200); @@ -96,7 +96,7 @@ trait K8sTestEntityTrait { foreach ($entities_data as $entity_data) { $this->assertText( - t('The @type "@label" has been @operation_passive.', [ + $this->t('The @type "@label" has been @operation_passive.', [ '@type' => $entity_data->getEntityType()->getLabel(), '@label' => $entity_data->label(), '@operation_passive' => $operation_passive, @@ -106,11 +106,11 @@ trait K8sTestEntityTrait { $operation_passive_upper = ucfirst($operation_passive); $message = \Drupal::translation()->formatPlural($entity_count, - t('@operation_passive_upper @entity_count item.', [ + $this->t('@operation_passive_upper @entity_count item.', [ '@operation_passive_upper' => $operation_passive_upper, '@entity_count' => $entity_count, ]), - t('@operation_passive_upper @entity_count items.', [ + $this->t('@operation_passive_upper @entity_count items.', [ '@operation_passive_upper' => $operation_passive_upper, '@entity_count' => $entity_count, ]) diff --git a/modules/cloud_service_providers/openstack/src/Entity/InstanceViewBuilder.php b/modules/cloud_service_providers/openstack/src/Entity/InstanceViewBuilder.php index 4848e137..aa4648d0 100644 --- a/modules/cloud_service_providers/openstack/src/Entity/InstanceViewBuilder.php +++ b/modules/cloud_service_providers/openstack/src/Entity/InstanceViewBuilder.php @@ -16,7 +16,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { return [ [ 'name' => 'instance', - 'title' => t('Instance'), + 'title' => $this->t('Instance'), 'open' => TRUE, 'fields' => [ 'instance_id', @@ -31,7 +31,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'network', - 'title' => t('Network'), + 'title' => $this->t('Network'), 'open' => TRUE, 'fields' => [ 'private_ips', @@ -44,7 +44,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'storage', - 'title' => t('Storage'), + 'title' => $this->t('Storage'), 'open' => TRUE, 'fields' => [ 'root_device_type', @@ -53,7 +53,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'options', - 'title' => t('Options'), + 'title' => $this->t('Options'), 'open' => TRUE, 'fields' => [ 'ami_launch_index', @@ -61,7 +61,7 @@ class InstanceViewBuilder extends AwsCloudViewBuilder { ], [ 'name' => 'others', - 'title' => t('Others'), + 'title' => $this->t('Others'), 'open' => FALSE, 'fields' => [ 'cloud_context', diff --git a/modules/tools/k8s_to_s3/src/Form/Config/K8sToS3AdminSettings.php b/modules/tools/k8s_to_s3/src/Form/Config/K8sToS3AdminSettings.php index f12c1582..1097d740 100644 --- a/modules/tools/k8s_to_s3/src/Form/Config/K8sToS3AdminSettings.php +++ b/modules/tools/k8s_to_s3/src/Form/Config/K8sToS3AdminSettings.php @@ -82,8 +82,8 @@ class K8sToS3AdminSettings extends ConfigFormBase { } $form['k8s']['k8s_clusters'] = [ - '#title' => t('K8s Clusters'), - '#description' => t('Select K8s clusters whose resources will be saved to S3 bucket.'), + '#title' => $this->t('K8s Clusters'), + '#description' => $this->t('Select K8s clusters whose resources will be saved to S3 bucket.'), '#type' => 'checkboxes', '#options' => $k8s_clusters_options, '#default_value' => empty($config->get('k8s_clusters')) @@ -103,8 +103,8 @@ class K8sToS3AdminSettings extends ConfigFormBase { $aws_clouds_options[$aws_cloud_config->getCloudContext()] = $aws_cloud_config->getName(); } $form['s3']['aws_cloud'] = [ - '#title' => t('AWS Cloud'), - '#description' => t('Select the AWS Cloud whose S3 bucket will be used.'), + '#title' => $this->t('AWS Cloud'), + '#description' => $this->t('Select the AWS Cloud whose S3 bucket will be used.'), '#type' => 'select', '#options' => $aws_clouds_options, '#default_value' => $config->get('aws_cloud'), @@ -112,8 +112,8 @@ class K8sToS3AdminSettings extends ConfigFormBase { ]; $form['s3']['s3_bucket'] = [ - '#title' => t('AWS S3 Bucket'), - '#description' => t('Specify the destination to which the resources of K8s Clusters will be saved to.'), + '#title' => $this->t('AWS S3 Bucket'), + '#description' => $this->t('Specify the destination to which the resources of K8s Clusters will be saved to.'), '#type' => 'textfield', '#default_value' => $config->get('s3_bucket'), '#required' => TRUE, diff --git a/modules/tools/s3_to_k8s/src/Form/Config/S3ToK8sAdminSettings.php b/modules/tools/s3_to_k8s/src/Form/Config/S3ToK8sAdminSettings.php index 7d3b1f37..20f7a52f 100644 --- a/modules/tools/s3_to_k8s/src/Form/Config/S3ToK8sAdminSettings.php +++ b/modules/tools/s3_to_k8s/src/Form/Config/S3ToK8sAdminSettings.php @@ -82,8 +82,8 @@ class S3ToK8sAdminSettings extends ConfigFormBase { $aws_clouds_options[$aws_cloud_config->getCloudContext()] = $aws_cloud_config->getName(); } $form['s3']['aws_cloud'] = [ - '#title' => t('AWS Cloud'), - '#description' => t('Select the AWS Cloud whose S3 bucket will be used.'), + '#title' => $this->t('AWS Cloud'), + '#description' => $this->t('Select the AWS Cloud whose S3 bucket will be used.'), '#type' => 'select', '#options' => $aws_clouds_options, '#default_value' => $config->get('aws_cloud'), @@ -91,16 +91,16 @@ class S3ToK8sAdminSettings extends ConfigFormBase { ]; $form['s3']['s3_bucket'] = [ - '#title' => t('AWS S3 Bucket'), - '#description' => t('Specify the source bucket from which the resources of K8s Cluster will be imported.'), + '#title' => $this->t('AWS S3 Bucket'), + '#description' => $this->t('Specify the source bucket from which the resources of K8s Cluster will be imported.'), '#type' => 'textfield', '#default_value' => $config->get('s3_bucket'), '#required' => TRUE, ]; $form['s3']['s3_path'] = [ - '#title' => t('AWS S3 Path'), - '#description' => t('Specify the source path from which the resources of K8s Cluster will be imported.'), + '#title' => $this->t('AWS S3 Path'), + '#description' => $this->t('Specify the source path from which the resources of K8s Cluster will be imported.'), '#type' => 'textfield', '#default_value' => $config->get('s3_path'), '#required' => TRUE, @@ -118,8 +118,8 @@ class S3ToK8sAdminSettings extends ConfigFormBase { } $form['k8s']['k8s_cluster'] = [ - '#title' => t('K8s Cluster'), - '#description' => t('Select the K8s cluster to which the K8s resources will be exported.'), + '#title' => $this->t('K8s Cluster'), + '#description' => $this->t('Select the K8s cluster to which the K8s resources will be exported.'), '#type' => 'select', '#options' => $k8s_clusters_options, '#default_value' => empty($config->get('k8s_cluster')) diff --git a/src/Controller/CloudServerTemplateListBuilder.php b/src/Controller/CloudServerTemplateListBuilder.php index 20210aee..774bf071 100644 --- a/src/Controller/CloudServerTemplateListBuilder.php +++ b/src/Controller/CloudServerTemplateListBuilder.php @@ -194,7 +194,7 @@ class CloudServerTemplateListBuilder extends CloudContentListBuilder implements // The header gives the table the information it needs in order to make // the query calls for ordering. TableSort uses the field information // to know what database column to sort by. - ['data' => t('Name'), 'specifier' => 'name', 'field' => 'name'], + ['data' => $this->t('Name'), 'specifier' => 'name', 'field' => 'name'], ]; // Call the plugin to build the header rows. @@ -285,7 +285,7 @@ class CloudServerTemplateListBuilder extends CloudContentListBuilder implements if ($entity->hasLinkTemplate('launch')) { if ($this->currentUser->hasPermission('launch cloud server template')) { $operations['launch'] = [ - 'title' => t('Launch'), + 'title' => $this->t('Launch'), 'url' => $entity->toUrl('launch'), 'weight' => 100, ]; @@ -294,7 +294,7 @@ class CloudServerTemplateListBuilder extends CloudContentListBuilder implements if ($entity->hasLinkTemplate('copy')) { if ($entity->access('update')) { $operations['copy'] = [ - 'title' => t('Copy'), + 'title' => $this->t('Copy'), 'url' => $entity->toUrl('copy'), 'weight' => 100, ]; diff --git a/src/Form/CloudConfigRevisionDeleteForm.php b/src/Form/CloudConfigRevisionDeleteForm.php index 04e17d01..15ebb22a 100644 --- a/src/Form/CloudConfigRevisionDeleteForm.php +++ b/src/Form/CloudConfigRevisionDeleteForm.php @@ -101,7 +101,7 @@ class CloudConfigRevisionDeleteForm extends ConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to delete the revision from %revision-date?', ['%revision-date' => \Drupal::service('date.formatter')->format($this->revision->getRevisionCreationTime())]); + return $this->t('Are you sure you want to delete the revision from %revision-date?', ['%revision-date' => \Drupal::service('date.formatter')->format($this->revision->getRevisionCreationTime())]); } /** @@ -115,7 +115,7 @@ class CloudConfigRevisionDeleteForm extends ConfirmFormBase { * {@inheritdoc} */ public function getConfirmText() { - return t('Delete'); + return $this->t('Delete'); } /** diff --git a/src/Form/CloudConfigRevisionRevertForm.php b/src/Form/CloudConfigRevisionRevertForm.php index 2c5a6400..2be8fe76 100644 --- a/src/Form/CloudConfigRevisionRevertForm.php +++ b/src/Form/CloudConfigRevisionRevertForm.php @@ -88,7 +88,7 @@ class CloudConfigRevisionRevertForm extends ConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to revert to the revision from %revision-date?', ['%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); + return $this->t('Are you sure you want to revert to the revision from %revision-date?', ['%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); } /** @@ -102,7 +102,7 @@ class CloudConfigRevisionRevertForm extends ConfirmFormBase { * {@inheritdoc} */ public function getConfirmText() { - return t('Revert'); + return $this->t('Revert'); } /** @@ -131,11 +131,11 @@ class CloudConfigRevisionRevertForm extends ConfirmFormBase { $original_revision_timestamp = $this->revision->getRevisionCreationTime(); $this->revision = $this->prepareRevertedRevision($this->revision, $form_state); - $this->revision->revision_log = t('Copy of the revision from %date.', ['%date' => $this->dateFormatter->format($original_revision_timestamp)]); + $this->revision->revision_log = $this->t('Copy of the revision from %date.', ['%date' => $this->dateFormatter->format($original_revision_timestamp)]); $this->revision->save(); $this->logger('content')->notice('Cloud service provider: reverted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]); - $this->messenger->addMessage(t('The cloud service provider %title has been reverted to the revision from %revision-date.', ['%title' => $this->revision->label(), '%revision-date' => $this->dateFormatter->format($original_revision_timestamp)])); + $this->messenger->addMessage($this->t('The cloud service provider %title has been reverted to the revision from %revision-date.', ['%title' => $this->revision->label(), '%revision-date' => $this->dateFormatter->format($original_revision_timestamp)])); $form_state->setRedirect( 'entity.cloud_config.version_history', ['cloud_config' => $this->revision->id()] diff --git a/src/Form/CloudConfigRevisionRevertTranslationForm.php b/src/Form/CloudConfigRevisionRevertTranslationForm.php index e806f167..9e25f92e 100644 --- a/src/Form/CloudConfigRevisionRevertTranslationForm.php +++ b/src/Form/CloudConfigRevisionRevertTranslationForm.php @@ -68,7 +68,7 @@ class CloudConfigRevisionRevertTranslationForm extends CloudConfigRevisionRevert * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to revert @language translation to the revision from %revision-date?', ['@language' => $this->languageManager->getLanguageName($this->langcode), '%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); + return $this->t('Are you sure you want to revert @language translation to the revision from %revision-date?', ['@language' => $this->languageManager->getLanguageName($this->langcode), '%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); } /** diff --git a/src/Form/CloudContentDeleteForm.php b/src/Form/CloudContentDeleteForm.php index 6b849d1d..88b3df62 100644 --- a/src/Form/CloudContentDeleteForm.php +++ b/src/Form/CloudContentDeleteForm.php @@ -58,7 +58,7 @@ class CloudContentDeleteForm extends ContentEntityConfirmFormBase { $entity = $this->entity; - return t('Are you sure you want to delete entity %name?', [ + return $this->t('Are you sure you want to delete entity %name?', [ '%name' => $entity->label(), ]); } @@ -74,7 +74,7 @@ class CloudContentDeleteForm extends ContentEntityConfirmFormBase { * {@inheritdoc} */ public function getConfirmText() { - return t('Delete'); + return $this->t('Delete'); } /** diff --git a/src/Form/CloudContentForm.php b/src/Form/CloudContentForm.php index a4c75eeb..edd2a020 100644 --- a/src/Form/CloudContentForm.php +++ b/src/Form/CloudContentForm.php @@ -148,7 +148,7 @@ class CloudContentForm extends ContentEntityForm { ]; $form['others']['langcode'] = [ - '#title' => t('Language'), + '#title' => $this->t('Language'), '#type' => 'language_select', '#default_value' => $this->entity->getUntranslated()->language()->getId(), '#languages' => Language::STATE_ALL, diff --git a/src/Form/CloudServerTemplateLaunchConfirm.php b/src/Form/CloudServerTemplateLaunchConfirm.php index f07a30ef..b2de93b5 100644 --- a/src/Form/CloudServerTemplateLaunchConfirm.php +++ b/src/Form/CloudServerTemplateLaunchConfirm.php @@ -57,7 +57,7 @@ class CloudServerTemplateLaunchConfirm extends ContentEntityConfirmFormBase { */ public function getQuestion() { $entity = $this->entity; - return t('Are you sure you want to launch an instance from %name?', [ + return $this->t('Are you sure you want to launch an instance from %name?', [ '%name' => $entity->label(), ]); } @@ -83,7 +83,7 @@ class CloudServerTemplateLaunchConfirm extends ContentEntityConfirmFormBase { * {@inheritdoc} */ public function getConfirmText() { - return t('Launch'); + return $this->t('Launch'); } /** diff --git a/src/Form/CloudServerTemplateRevisionDeleteForm.php b/src/Form/CloudServerTemplateRevisionDeleteForm.php index a8092078..95eb3ee0 100644 --- a/src/Form/CloudServerTemplateRevisionDeleteForm.php +++ b/src/Form/CloudServerTemplateRevisionDeleteForm.php @@ -101,7 +101,7 @@ class CloudServerTemplateRevisionDeleteForm extends ConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to delete the revision from %revision-date?', ['%revision-date' => \Drupal::service('date.formatter')->format($this->revision->getRevisionCreationTime())]); + return $this->t('Are you sure you want to delete the revision from %revision-date?', ['%revision-date' => \Drupal::service('date.formatter')->format($this->revision->getRevisionCreationTime())]); } /** @@ -118,7 +118,7 @@ class CloudServerTemplateRevisionDeleteForm extends ConfirmFormBase { * {@inheritdoc} */ public function getConfirmText() { - return t('Delete'); + return $this->t('Delete'); } /** diff --git a/src/Form/CloudServerTemplateRevisionRevertForm.php b/src/Form/CloudServerTemplateRevisionRevertForm.php index f55f11d3..b53a116d 100644 --- a/src/Form/CloudServerTemplateRevisionRevertForm.php +++ b/src/Form/CloudServerTemplateRevisionRevertForm.php @@ -88,7 +88,7 @@ class CloudServerTemplateRevisionRevertForm extends ConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to revert to the revision from %revision-date?', ['%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); + return $this->t('Are you sure you want to revert to the revision from %revision-date?', ['%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); } /** @@ -105,7 +105,7 @@ class CloudServerTemplateRevisionRevertForm extends ConfirmFormBase { * {@inheritdoc} */ public function getConfirmText() { - return t('Revert'); + return $this->t('Revert'); } /** @@ -134,11 +134,11 @@ class CloudServerTemplateRevisionRevertForm extends ConfirmFormBase { $original_revision_timestamp = $this->revision->getRevisionCreationTime(); $this->revision = $this->prepareRevertedRevision($this->revision, $form_state); - $this->revision->revision_log = t('Copy of the revision from %date.', ['%date' => $this->dateFormatter->format($original_revision_timestamp)]); + $this->revision->revision_log = $this->t('Copy of the revision from %date.', ['%date' => $this->dateFormatter->format($original_revision_timestamp)]); $this->revision->save(); $this->logger('content')->notice('Cloud server template: reverted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]); - $this->messenger->addMessage(t('Cloud server template %title has been reverted to the revision from %revision-date.', ['%title' => $this->revision->label(), '%revision-date' => $this->dateFormatter->format($original_revision_timestamp)])); + $this->messenger->addMessage($this->t('Cloud server template %title has been reverted to the revision from %revision-date.', ['%title' => $this->revision->label(), '%revision-date' => $this->dateFormatter->format($original_revision_timestamp)])); $form_state->setRedirect( 'entity.cloud_server_template.version_history', [ 'cloud_context' => $this->revision->getCloudContext(), diff --git a/src/Form/CloudServerTemplateRevisionRevertTranslationForm.php b/src/Form/CloudServerTemplateRevisionRevertTranslationForm.php index 71886eaa..c664e390 100644 --- a/src/Form/CloudServerTemplateRevisionRevertTranslationForm.php +++ b/src/Form/CloudServerTemplateRevisionRevertTranslationForm.php @@ -68,7 +68,7 @@ class CloudServerTemplateRevisionRevertTranslationForm extends CloudServerTempla * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to revert @language translation to the revision from %revision-date?', ['@language' => $this->languageManager->getLanguageName($this->langcode), '%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); + return $this->t('Are you sure you want to revert @language translation to the revision from %revision-date?', ['@language' => $this->languageManager->getLanguageName($this->langcode), '%revision-date' => $this->dateFormatter->format($this->revision->getRevisionCreationTime())]); } /** diff --git a/src/Plugin/Block/CloudConfigLocationBlock.php b/src/Plugin/Block/CloudConfigLocationBlock.php index e94edf72..35640815 100644 --- a/src/Plugin/Block/CloudConfigLocationBlock.php +++ b/src/Plugin/Block/CloudConfigLocationBlock.php @@ -132,7 +132,7 @@ class CloudConfigLocationBlock extends BlockBase implements ContainerFactoryPlug $fieldset_defs = [ [ 'name' => 'cloud_config_location', - 'title' => t('Location Map'), + 'title' => $this->t('Location Map'), 'open' => TRUE, 'fields' => [ 'cloud_config_location_map',