-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-56349: [GITHUB] Newsletter Queue doesn't set to local time #5943
- Loading branch information
1 parent
29eb476
commit 106513f
Showing
8 changed files
with
182 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...s/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueueInGrid.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Newsletter\Test\Constraint; | ||
|
||
use Magento\Mtf\Constraint\AbstractAssertForm; | ||
use Magento\Newsletter\Test\Fixture\Queue; | ||
use Magento\Newsletter\Test\Page\Adminhtml\TemplateQueueIndex; | ||
|
||
/** | ||
* Assert that Newsletter Queue is present in grid. | ||
*/ | ||
class AssertNewsletterQueueInGrid extends AbstractAssertForm | ||
{ | ||
/** | ||
* Assert that Newsletter Queue is present in grid. | ||
* | ||
* @param TemplateQueueIndex $indexQueue | ||
* @param Queue $queue | ||
* @return void | ||
*/ | ||
public function processAssert( | ||
TemplateQueueIndex $indexQueue, | ||
Queue $queue | ||
) { | ||
$indexQueue->open(); | ||
$filter = [ | ||
'newsletter_subject' => $queue->getNewsletterSubject(), | ||
]; | ||
|
||
\PHPUnit_Framework_Assert::assertTrue( | ||
$indexQueue->getQueueTemplateGrid()->isRowVisible($filter), | ||
'Newsletter Queue \'' . $queue->getNewsletterSubject() . '\' is absent in grid.' | ||
); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function toString() | ||
{ | ||
return 'Newsletter Queue is present in grid.'; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...ctional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueueSaveMessage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Newsletter\Test\Constraint; | ||
|
||
use Magento\Mtf\Constraint\AbstractAssertForm; | ||
use Magento\Newsletter\Test\Page\Adminhtml\TemplateQueueIndex; | ||
|
||
/** | ||
* Assert that Newsletter Queue success save message is present. | ||
*/ | ||
class AssertNewsletterQueueSaveMessage extends AbstractAssertForm | ||
{ | ||
/** | ||
* Text value to be checked. | ||
*/ | ||
const SUCCESS_MESSAGE = 'You saved the newsletter queue.'; | ||
|
||
/** | ||
* Assert that Newsletter Queue success save message is present. | ||
* | ||
* @param TemplateQueueIndex $indexQueue | ||
* @return void | ||
*/ | ||
public function processAssert( | ||
TemplateQueueIndex $indexQueue | ||
) { | ||
$actualMessages = $indexQueue->getMessagesBlock()->getSuccessMessages(); | ||
\PHPUnit_Framework_Assert::assertContains( | ||
self::SUCCESS_MESSAGE, | ||
$actualMessages, | ||
'Wrong success message is displayed.' | ||
. "\nExpected: " . self::SUCCESS_MESSAGE | ||
. "\nActual:\n" . implode("\n - ", $actualMessages) | ||
); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function toString() | ||
{ | ||
return 'Newsletter Queue success save message is present.'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
dev/tests/functional/tests/app/Magento/Newsletter/Test/Fixture/Queue/Stores.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Newsletter\Test\Fixture\Queue; | ||
|
||
use Magento\Mtf\Fixture\DataSource; | ||
use Magento\Mtf\Fixture\FixtureFactory; | ||
|
||
/** | ||
* Data source for 'stores' field. | ||
* | ||
* Data keys: | ||
* - dataset | ||
*/ | ||
class Stores extends DataSource | ||
{ | ||
/** | ||
* Array with store fixtures. | ||
* | ||
* @var array | ||
*/ | ||
protected $stores; | ||
|
||
/** | ||
* Create custom Store if we have block with custom store view. | ||
* | ||
* @constructor | ||
* @param FixtureFactory $fixtureFactory | ||
* @param array $params | ||
* @param array $data [optional] | ||
*/ | ||
public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) | ||
{ | ||
$this->params = $params; | ||
if (isset($data['dataset'])) { | ||
$datasets = is_array($data['dataset']) ? $data['dataset'] : [$data['dataset']]; | ||
foreach ($datasets as $dataset) { | ||
/** @var \Magento\Store\Test\Fixture\Store $store */ | ||
$store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); | ||
if (!$store->hasData('store_id')) { | ||
$store->persist(); | ||
} | ||
$this->stores[] = $store; | ||
$this->data[] = $store->getGroupId() . '/' . $store->getName(); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Return stores. | ||
* | ||
* @return array | ||
*/ | ||
public function getStores() | ||
{ | ||
return $this->stores; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters