Skip to content

Commit 6063729

Browse files
MC-30944: Incorrect flow of saving Newsletter templates
1 parent 3f2cff4 commit 6063729

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

dev/tests/integration/testsuite/Magento/Newsletter/Controller/Adminhtml/NewsletterTemplateTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,19 @@ protected function tearDown()
6262
public function testSaveActionCreateNewTemplateAndVerifySuccessMessage()
6363
{
6464
$this->getRequest()->setParam('id', $this->model->getId());
65+
$this->getRequest()->setParam('is_legacy', 1);
66+
6567
$this->dispatch('backend/newsletter/template/save');
68+
6669
/**
6770
* Check that errors was generated and set to session
6871
*/
6972
$this->assertSessionMessages($this->isEmpty(), \Magento\Framework\Message\MessageInterface::TYPE_ERROR);
73+
74+
$this->model->load($this->getRequest()->getPostValue('code'), 'template_code');
75+
76+
$this->assertEquals(0, $this->model->getIsLegacy());
77+
7078
/**
7179
* Check that success message is set
7280
*/
@@ -90,13 +98,19 @@ public function testSaveActionEditTemplateAndVerifySuccessMessage()
9098
$this->assertEquals('some_unique_code', $this->model->getTemplateCode());
9199

92100
$this->getRequest()->setParam('id', $this->model->getId());
101+
$this->getRequest()->setParam('is_legacy', 1);
102+
93103
$this->dispatch('backend/newsletter/template/save');
94104

95105
/**
96106
* Check that errors was generated and set to session
97107
*/
98108
$this->assertSessionMessages($this->isEmpty(), \Magento\Framework\Message\MessageInterface::TYPE_ERROR);
99109

110+
$this->model->load($this->getRequest()->getPostValue('code'), 'template_code');
111+
112+
$this->assertEquals(0, $this->model->getIsLegacy());
113+
100114
/**
101115
* Check that success message is set
102116
*/

0 commit comments

Comments
 (0)