Fix tests
This commit is contained in:
@ -97,18 +97,18 @@ class CustomFieldsTest extends MailPoetTest {
|
||||
// missing type
|
||||
$response = $router->save(array('name' => 'New custom field'));
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please specify a type');
|
||||
expect($response->errors[0]['message'])->equals('Please specify a type.');
|
||||
|
||||
// missing name
|
||||
$response = $router->save(array('type' => 'text'));
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name');
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name.');
|
||||
|
||||
// missing data
|
||||
$response = $router->save();
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name');
|
||||
expect($response->errors[1]['message'])->equals('Please specify a type');
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name.');
|
||||
expect($response->errors[1]['message'])->equals('Please specify a type.');
|
||||
}
|
||||
|
||||
function testItCanGetACustomField() {
|
||||
|
@ -65,7 +65,7 @@ class FormsTest extends MailPoetTest {
|
||||
$router = new Forms();
|
||||
$response = $router->save(/* missing data */);
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name');
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name.');
|
||||
|
||||
$response = $router->save($form_data);
|
||||
expect($response->status)->equals(APIResponse::STATUS_OK);
|
||||
|
@ -80,7 +80,7 @@ class NewslettersTest extends MailPoetTest {
|
||||
|
||||
$response = $router->save($invalid_data);
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please specify a type');
|
||||
expect($response->errors[0]['message'])->equals('Please specify a type.');
|
||||
}
|
||||
|
||||
function testItCanSaveAnExistingNewsletter() {
|
||||
@ -284,7 +284,7 @@ class NewslettersTest extends MailPoetTest {
|
||||
|
||||
$response = $router->create();
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please specify a type');
|
||||
expect($response->errors[0]['message'])->equals('Please specify a type.');
|
||||
}
|
||||
|
||||
function testItCanGetListingData() {
|
||||
@ -562,4 +562,4 @@ class NewslettersTest extends MailPoetTest {
|
||||
NewsletterOptionField::deleteMany();
|
||||
Segment::deleteMany();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class SegmentsTest extends MailPoetTest {
|
||||
$router = new Segments();
|
||||
$response = $router->save(/* missing data */);
|
||||
expect($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name');
|
||||
expect($response->errors[0]['message'])->equals('Please specify a name.');
|
||||
|
||||
$response = $router->save($segment_data);
|
||||
expect($response->status)->equals(APIResponse::STATUS_OK);
|
||||
|
@ -64,7 +64,7 @@ class MailerTest extends MailPoetTest {
|
||||
$mailer = new Mailer();
|
||||
$this->fail('Mailer did not throw an exception');
|
||||
} catch(Exception $e) {
|
||||
expect($e->getMessage())->equals('Mailer is not configured');
|
||||
expect($e->getMessage())->equals('Mailer is not configured.');
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ class MailerTest extends MailPoetTest {
|
||||
$mailer = new Mailer($mailer = $this->mailer);
|
||||
$this->fail('Mailer did not throw an exception');
|
||||
} catch(Exception $e) {
|
||||
expect($e->getMessage())->equals('Sender name and email are not configured');
|
||||
expect($e->getMessage())->equals('Sender name and email are not configured.');
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class MailerTest extends MailPoetTest {
|
||||
$mailer = new Mailer(array('method' => 'Unknown'), $this->sender);
|
||||
$this->fail('Mailer did not throw an exception');
|
||||
} catch(Exception $e) {
|
||||
expect($e->getMessage())->equals('Mailing method does not exist');
|
||||
expect($e->getMessage())->equals('Mailing method does not exist.');
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,4 +175,4 @@ class MailerTest extends MailPoetTest {
|
||||
$result = $mailer->send($this->newsletter, $this->subscriber);
|
||||
expect($result['response'])->true();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class AmazonSESTest extends MailPoetTest {
|
||||
);
|
||||
$this->fail('Unsupported region exception was not thrown');
|
||||
} catch(\Exception $e) {
|
||||
expect($e->getMessage())->equals('Unsupported Amazon SES region.');
|
||||
expect($e->getMessage())->equals('Unsupported Amazon SES region');
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,4 +223,4 @@ class AmazonSESTest extends MailPoetTest {
|
||||
);
|
||||
expect($result['response'])->true();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,8 +72,8 @@ class CustomFieldTest extends MailPoetTest {
|
||||
$errors = $result->getErrors();
|
||||
|
||||
expect(is_array($errors))->true();
|
||||
expect($errors[0])->equals('Please specify a name');
|
||||
expect($errors[1])->equals('Please specify a type');
|
||||
expect($errors[0])->equals('Please specify a name.');
|
||||
expect($errors[1])->equals('Please specify a type.');
|
||||
}
|
||||
|
||||
function testItHasACreatedAtOnCreation() {
|
||||
|
@ -19,7 +19,7 @@ class FormTest extends MailPoetTest {
|
||||
$errors = $result->getErrors();
|
||||
|
||||
expect(is_array($errors))->true();
|
||||
expect($errors[0])->equals('Please specify a name');
|
||||
expect($errors[0])->equals('Please specify a name.');
|
||||
}
|
||||
|
||||
function testItCanBeGrouped() {
|
||||
|
@ -52,8 +52,8 @@ class NewsletterOptionFieldTest extends MailPoetTest {
|
||||
$errors = $result->getErrors();
|
||||
|
||||
expect(is_array($errors))->true();
|
||||
expect($errors[0])->equals('Please specify a name');
|
||||
expect($errors[1])->equals('Please specify a newsletter type');
|
||||
expect($errors[0])->equals('Please specify a name.');
|
||||
expect($errors[1])->equals('Please specify a newsletter type.');
|
||||
}
|
||||
|
||||
function testItHasACreatedAtOnCreation() {
|
||||
|
@ -26,8 +26,8 @@ class NewsletterTemplateTest extends MailPoetTest {
|
||||
$errors = $result->getErrors();
|
||||
|
||||
expect(is_array($errors))->true();
|
||||
expect($errors[0])->equals('Please specify a name');
|
||||
expect($errors[1])->equals('The template body cannot be empty');
|
||||
expect($errors[0])->equals('Please specify a name.');
|
||||
expect($errors[1])->equals('The template body cannot be empty.');
|
||||
}
|
||||
|
||||
function testItHasName() {
|
||||
|
@ -72,7 +72,7 @@ class SegmentTest extends MailPoetTest {
|
||||
$errors = $result->getErrors();
|
||||
|
||||
expect(is_array($errors))->true();
|
||||
expect($errors[0])->equals('Please specify a name');
|
||||
expect($errors[0])->equals('Please specify a name.');
|
||||
}
|
||||
|
||||
function testItHasACreatedAtOnCreation() {
|
||||
|
@ -16,7 +16,7 @@ class SettingTest extends MailPoetTest {
|
||||
$errors = $invalid_setting->getErrors();
|
||||
|
||||
expect($errors)->notEmpty();
|
||||
expect($errors[0])->equals('Please specify a name');
|
||||
expect($errors[0])->equals('Please specify a name.');
|
||||
}
|
||||
|
||||
function testItHasDefaultSettings() {
|
||||
|
@ -61,7 +61,7 @@ class FrontRouterTest extends MailPoetTest {
|
||||
expect($result)->equals(
|
||||
array(
|
||||
404,
|
||||
'Invalid router endpoint.'
|
||||
'Invalid router endpoint'
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -138,4 +138,4 @@ class FrontRouterTest extends MailPoetTest {
|
||||
);
|
||||
expect($result)->contains(Router::NAME . '&endpoint=mock_endpoint&action=test&data=' . $encoded_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user