Models unit tests update

This commit is contained in:
Jonathan Labreuille
2016-06-27 13:53:56 +02:00
parent 264b7e180b
commit 306cdeb68f
5 changed files with 109 additions and 3 deletions

View File

@ -34,6 +34,19 @@ class CustomFieldTest extends MailPoetTest {
expect($this->custom_field->getErrors())->false();
}
function testItCanBeUpdated() {
expect($this->custom_field->name)->equals($this->data['name']);
$updated_custom_field = CustomField::createOrUpdate(array(
'id' => $this->custom_field->id,
'name' => 'Country'
));
expect($updated_custom_field->getErrors())->false();
expect($updated_custom_field->name)->equals('Country');
expect($updated_custom_field->id)->equals($this->custom_field->id);
}
function testItHasAName() {
expect($this->custom_field->name)->equals($this->data['name']);
}