diff --git a/tests/integration/API/JSON/v1/SegmentsTest.php b/tests/integration/API/JSON/v1/SegmentsTest.php index c42710cfa5..02d0b39f4c 100644 --- a/tests/integration/API/JSON/v1/SegmentsTest.php +++ b/tests/integration/API/JSON/v1/SegmentsTest.php @@ -79,9 +79,7 @@ class SegmentsTest extends \MailPoetTest { $response = $this->endpoint->save($duplicateEntry); expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST); - expect($response->errors[0]['message'])->equals( - 'Another record already exists. Please specify a different "name".' - ); + expect($response->errors[0]['message'])->regExp('/Another record already exists. Please specify a different ".*name"./'); } public function testItCanRestoreASegment() { diff --git a/tests/integration/DynamicSegments/Persistence/SaverTest.php b/tests/integration/DynamicSegments/Persistence/SaverTest.php index 3a4d473326..5cc0f8e461 100644 --- a/tests/integration/DynamicSegments/Persistence/SaverTest.php +++ b/tests/integration/DynamicSegments/Persistence/SaverTest.php @@ -47,7 +47,8 @@ class SaverTest extends \MailPoetTest { 'description' => 'desc2', 'id' => $dynamicSegment1->id, ]); - $this->setExpectedException('\MailPoet\DynamicSegments\Exceptions\ErrorSavingException', 'Another record already exists. Please specify a different "PRIMARY".', Model::DUPLICATE_RECORD); + $this->expectException('\MailPoet\DynamicSegments\Exceptions\ErrorSavingException'); + $this->expectExceptionCode(Model::DUPLICATE_RECORD); $this->saver->save($dynamicSegment2); }