Save new templates image data to the new columns

[MAILPOET-2686]
This commit is contained in:
Rostislav Wolny
2021-10-15 12:47:47 +02:00
committed by Veljko V
parent f5e4bab40b
commit b51f7b2d0e
3 changed files with 10 additions and 2 deletions

View File

@@ -18,17 +18,21 @@ class NewsletterTemplatesRepositoryTest extends \MailPoetTest {
$createdTemplate = $this->newsletterTemplatesRepository->createOrUpdate([
'name' => 'Another template',
'body' => '{"content": {}, "globalStyles": {}}',
'thumbnail_data' => 'data:image/gif;base64,R0lGODlhAQABAAAAACw=',
]);
expect($createdTemplate->getName())->equals('Another template');
expect($createdTemplate->getBody())->equals(['content' => [], 'globalStyles' => []]);
expect($createdTemplate->getThumbnailData())->equals('data:image/gif;base64,R0lGODlhAQABAAAAACw=');
$updatedTemplate = $this->newsletterTemplatesRepository->createOrUpdate([
'id' => $createdTemplate->getId(),
'name' => 'Another template updated',
'body' => '{"content": "changed"}',
'thumbnail_data' => 'data:image/gif;base64,R0lGO==',
]);
expect($updatedTemplate->getName())->equals('Another template updated');
expect($updatedTemplate->getBody())->equals(['content' => 'changed']);
expect($updatedTemplate->getThumbnailData())->equals('data:image/gif;base64,R0lGO==');
}
public function testItCleansRecentlySent() {