Convert variable names to camel case
[MAILPOET-1796]
This commit is contained in:
@@ -13,7 +13,7 @@ class RequiredCustomFieldValidatorTest extends \MailPoetTest {
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
ORM::raw_execute('TRUNCATE ' . CustomField::$_table);
|
||||
$this->custom_field = CustomField::createOrUpdate([
|
||||
$this->customField = CustomField::createOrUpdate([
|
||||
'name' => 'custom field',
|
||||
'type' => 'text',
|
||||
'params' => ['required' => '1'],
|
||||
@@ -28,24 +28,24 @@ class RequiredCustomFieldValidatorTest extends \MailPoetTest {
|
||||
|
||||
public function testItValidatesDataWithCustomFieldPassedAsId() {
|
||||
$validator = new RequiredCustomFieldValidator();
|
||||
$validator->validate([$this->custom_field->id() => 'value']);
|
||||
$validator->validate([$this->customField->id() => 'value']);
|
||||
}
|
||||
|
||||
public function testItValidatesDataWithCustomFieldPassedAsCFId() {
|
||||
$validator = new RequiredCustomFieldValidator();
|
||||
$validator->validate(['cf_' . $this->custom_field->id() => 'custom field']);
|
||||
$validator->validate(['cf_' . $this->customField->id() => 'custom field']);
|
||||
}
|
||||
|
||||
public function testItValidatesDataWithEmptyCustomField() {
|
||||
$validator = new RequiredCustomFieldValidator();
|
||||
$this->setExpectedException('Exception');
|
||||
$validator->validate([$this->custom_field->id() => '']);
|
||||
$validator->validate([$this->customField->id() => '']);
|
||||
}
|
||||
|
||||
public function testItValidatesDataWithEmptyCustomFieldAsCFId() {
|
||||
$validator = new RequiredCustomFieldValidator();
|
||||
$this->setExpectedException('Exception');
|
||||
$validator->validate(['cf_' . $this->custom_field->id() => '']);
|
||||
$validator->validate(['cf_' . $this->customField->id() => '']);
|
||||
}
|
||||
|
||||
public function testItValidatesOnlyFieldPresentInForm() {
|
||||
@@ -59,7 +59,7 @@ class RequiredCustomFieldValidatorTest extends \MailPoetTest {
|
||||
'body' => [[
|
||||
'type' => 'text',
|
||||
'name' => 'mandatory',
|
||||
'id' => $this->custom_field->id(),
|
||||
'id' => $this->customField->id(),
|
||||
'unique' => '1',
|
||||
'static' => '0',
|
||||
'params' => ['required' => '1'],
|
||||
@@ -67,7 +67,7 @@ class RequiredCustomFieldValidatorTest extends \MailPoetTest {
|
||||
]],
|
||||
]);
|
||||
$validator = new RequiredCustomFieldValidator();
|
||||
$validator->validate(['cf_' . $this->custom_field->id() => 'value'], $form);
|
||||
$validator->validate(['cf_' . $this->customField->id() => 'value'], $form);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user