forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests coverage.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
app/code/Magento/MessageQueue/Test/Integration/PoisonPillAppyAfterCommandRunTest.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,56 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\MessageQueue\Test\Integration; | ||
|
||
use Magento\Framework\MessageQueue\PoisonPill\PoisonPillCompareInterface; | ||
use Magento\Framework\MessageQueue\PoisonPill\PoisonPillReadInterface; | ||
use Magento\Framework\Shell; | ||
use Magento\TestFramework\Helper\Bootstrap; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class PoisonPillAppyAfterCommandRunTest extends TestCase | ||
{ | ||
/** | ||
* @var PoisonPillReadInterface | ||
*/ | ||
private $poisonPillRead; | ||
|
||
/** | ||
* @var PoisonPillCompareInterface | ||
*/ | ||
private $poisonPillCompare; | ||
|
||
/** | ||
* @var Shell | ||
*/ | ||
private $shell; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function setUp(): void | ||
{ | ||
$objectManager = Bootstrap::getObjectManager(); | ||
$this->poisonPillRead = $objectManager->get(PoisonPillReadInterface::class); | ||
$this->poisonPillCompare = $objectManager->get(PoisonPillCompareInterface::class); | ||
$this->shell = $objectManager->get(Shell::class); | ||
} | ||
|
||
/** | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
* @covers \Magento\MessageQueue\Setup\Recurring | ||
* | ||
* @magentoDbIsolation disabled | ||
*/ | ||
public function testChangeVersion() | ||
{ | ||
$version = $this->poisonPillRead->getLatestVersion(); | ||
$this->shell->execute(PHP_BINARY . ' -f %s queue:consumers:restart', [BP . '/bin/magento']); | ||
$this->assertEquals(false, $this->poisonPillCompare->isLatestVersion($version)); | ||
} | ||
} |