Skip to content

Commit

Permalink
magento#23540: Queue consumers.
Browse files Browse the repository at this point in the history
Add integration tests coverage.
  • Loading branch information
swnsma committed Feb 2, 2021
1 parent 31de411 commit 956ae57
Showing 1 changed file with 56 additions and 0 deletions.
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));
}
}

0 comments on commit 956ae57

Please sign in to comment.