Skip to content

Commit 4da31ea

Browse files
committed
Fix static tests and small alignments
1 parent 77d62ef commit 4da31ea

File tree

1 file changed

+27
-14
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend

1 file changed

+27
-14
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Model/Attribute/Backend/ConsumerTest.php

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,34 @@
88

99
namespace Magento\Catalog\Model\Attribute\Backend;
1010

11+
use Magento\AsynchronousOperations\Api\Data\OperationInterface;
1112
use Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory;
12-
use PHPUnit\Framework\TestCase;
13-
use Magento\TestFramework\Helper\Bootstrap;
14-
use Magento\Framework\ObjectManagerInterface;
1513
use Magento\AsynchronousOperations\Model\BulkManagement;
1614
use Magento\AsynchronousOperations\Model\BulkStatus;
17-
use Magento\AsynchronousOperations\Api\Data\OperationInterface;
1815
use Magento\Framework\MessageQueue\BulkPublisherInterface;
16+
use Magento\Framework\ObjectManagerInterface;
17+
use Magento\TestFramework\Helper\Bootstrap;
18+
use PHPUnit\Framework\TestCase;
19+
use Magento\Catalog\Helper\Product;
20+
use Magento\Catalog\Model\Indexer\Product\Flat\Processor;
21+
use Magento\Framework\Bulk\OperationManagementInterface;
22+
use Magento\Catalog\Model\Product\Action;
23+
use Psr\Log\LoggerInterface;
24+
use Magento\Framework\Serialize\SerializerInterface;
25+
use Magento\Framework\EntityManager\EntityManager;
26+
use Magento\Catalog\Model\Attribute\Backend\Consumer;
1927

28+
/**
29+
* Test for Mysql Consumer execution
30+
*
31+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
32+
*/
2033
class ConsumerTest extends TestCase
2134
{
2235
const BULK_UUID = '5a12c1bd-a8b5-41d4-8c00-3f5bcaa6d3c8';
2336

2437
/**
25-
* @var \Magento\Catalog\Model\Attribute\Backend\Consumer
38+
* @var Consumer
2639
*/
2740
private $model;
2841

@@ -47,7 +60,7 @@ class ConsumerTest extends TestCase
4760
private $objectManager;
4861

4962
/**
50-
* @var \Magento\Framework\Serialize\SerializerInterface
63+
* @var SerializerInterface
5164
*/
5265
private $serializer;
5366

@@ -66,20 +79,20 @@ protected function setUp(): void
6679
]
6780
);
6881
$this->bulkStatus = $this->objectManager->get(BulkStatus::class);
69-
$catalogProductMock = $this->createMock(\Magento\Catalog\Helper\Product::class);
82+
$catalogProductMock = $this->createMock(Product::class);
7083
$productFlatIndexerProcessorMock = $this->createMock(
71-
\Magento\Catalog\Model\Indexer\Product\Flat\Processor::class
84+
Processor::class
7285
);
7386
$productPriceIndexerProcessorMock = $this->createMock(
74-
\Magento\Catalog\Model\Indexer\Product\Price\Processor::class
87+
Processor::class
7588
);
7689
$operationManagementMock = $this->createMock(
77-
\Magento\Framework\Bulk\OperationManagementInterface::class
90+
OperationManagementInterface::class
7891
);
79-
$actionMock = $this->createMock(\Magento\Catalog\Model\Product\Action::class);
80-
$loggerMock = $this->createMock(\Psr\Log\LoggerInterface::class);
81-
$this->serializer = $this->objectManager->get(\Magento\Framework\Serialize\SerializerInterface::class);
82-
$entityManager = $this->objectManager->get(\Magento\Framework\EntityManager\EntityManager::class);
92+
$actionMock = $this->createMock(Action::class);
93+
$loggerMock = $this->createMock(LoggerInterface::class);
94+
$this->serializer = $this->objectManager->get(SerializerInterface::class);
95+
$entityManager = $this->objectManager->get(EntityManager::class);
8396
$this->model = $this->objectManager->create(
8497
Consumer::class,
8598
[

0 commit comments

Comments
 (0)