diff --git a/lib/API/JSON/v1/DynamicSegments.php b/lib/API/JSON/v1/DynamicSegments.php index ee0819844c..809b306d89 100644 --- a/lib/API/JSON/v1/DynamicSegments.php +++ b/lib/API/JSON/v1/DynamicSegments.php @@ -121,22 +121,22 @@ class DynamicSegments extends APIEndpoint { private function getErrorString(InvalidFilterException $e) { switch ($e->getCode()) { case InvalidFilterException::MISSING_TYPE: - return WPFunctions::get()->__('Segment type is missing.', 'mailpoet'); + return WPFunctions::get()->__('The segment type is missing.', 'mailpoet'); case InvalidFilterException::INVALID_TYPE: - return WPFunctions::get()->__('Segment type is unknown.', 'mailpoet'); + return WPFunctions::get()->__('The segment type is unknown.', 'mailpoet'); case InvalidFilterException::MISSING_ROLE: - return WPFunctions::get()->__('Please select user role.', 'mailpoet'); + return WPFunctions::get()->__('Please select a user role.', 'mailpoet'); case InvalidFilterException::MISSING_ACTION: case InvalidFilterException::INVALID_EMAIL_ACTION: - return WPFunctions::get()->__('Please select email action.', 'mailpoet'); + return WPFunctions::get()->__('Please select an email action.', 'mailpoet'); case InvalidFilterException::MISSING_NEWSLETTER_ID: return WPFunctions::get()->__('Please select an email.', 'mailpoet'); case InvalidFilterException::MISSING_PRODUCT_ID: - return WPFunctions::get()->__('Please select product.', 'mailpoet'); + return WPFunctions::get()->__('Please select a product.', 'mailpoet'); case InvalidFilterException::MISSING_COUNTRY: - return WPFunctions::get()->__('Please select country.', 'mailpoet'); + return WPFunctions::get()->__('Please select a country.', 'mailpoet'); case InvalidFilterException::MISSING_CATEGORY_ID: - return WPFunctions::get()->__('Please select category.', 'mailpoet'); + return WPFunctions::get()->__('Please select a category.', 'mailpoet'); case InvalidFilterException::MISSING_VALUE: return WPFunctions::get()->__('Please fill all required values.', 'mailpoet'); case InvalidFilterException::MISSING_NUMBER_OF_ORDERS_FIELDS: diff --git a/tests/integration/API/JSON/v1/DynamicSegmentsTest.php b/tests/integration/API/JSON/v1/DynamicSegmentsTest.php index 2b228fe624..4c370cffb3 100644 --- a/tests/integration/API/JSON/v1/DynamicSegmentsTest.php +++ b/tests/integration/API/JSON/v1/DynamicSegmentsTest.php @@ -56,7 +56,7 @@ class DynamicSegmentsTest extends \MailPoetTest { ]); expect($response)->isInstanceOf('\MailPoet\API\JSON\ErrorResponse'); expect($response->status)->equals(self::INVALID_DATA_RESPONSE_CODE); - expect($response->errors[0]['message'])->equals('Segment type is missing.'); + expect($response->errors[0]['message'])->equals('The segment type is missing.'); } public function testSaverReturnsErrorOnDuplicateRecord() {