8
8
9
9
namespace Magento \Catalog \Model \Attribute \Backend ;
10
10
11
+ use Magento \AsynchronousOperations \Api \Data \OperationInterface ;
11
12
use Magento \AsynchronousOperations \Api \Data \OperationInterfaceFactory ;
12
- use PHPUnit \Framework \TestCase ;
13
- use Magento \TestFramework \Helper \Bootstrap ;
14
- use Magento \Framework \ObjectManagerInterface ;
15
13
use Magento \AsynchronousOperations \Model \BulkManagement ;
16
14
use Magento \AsynchronousOperations \Model \BulkStatus ;
17
- use Magento \AsynchronousOperations \Api \Data \OperationInterface ;
18
15
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 ;
19
27
28
+ /**
29
+ * Test for Mysql Consumer execution
30
+ *
31
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
32
+ */
20
33
class ConsumerTest extends TestCase
21
34
{
22
35
const BULK_UUID = '5a12c1bd-a8b5-41d4-8c00-3f5bcaa6d3c8 ' ;
23
36
24
37
/**
25
- * @var \Magento\Catalog\Model\Attribute\Backend\ Consumer
38
+ * @var Consumer
26
39
*/
27
40
private $ model ;
28
41
@@ -47,7 +60,7 @@ class ConsumerTest extends TestCase
47
60
private $ objectManager ;
48
61
49
62
/**
50
- * @var \Magento\Framework\Serialize\ SerializerInterface
63
+ * @var SerializerInterface
51
64
*/
52
65
private $ serializer ;
53
66
@@ -66,20 +79,20 @@ protected function setUp(): void
66
79
]
67
80
);
68
81
$ this ->bulkStatus = $ this ->objectManager ->get (BulkStatus::class);
69
- $ catalogProductMock = $ this ->createMock (\ Magento \ Catalog \ Helper \ Product::class);
82
+ $ catalogProductMock = $ this ->createMock (Product::class);
70
83
$ productFlatIndexerProcessorMock = $ this ->createMock (
71
- \ Magento \ Catalog \ Model \ Indexer \ Product \ Flat \ Processor::class
84
+ Processor::class
72
85
);
73
86
$ productPriceIndexerProcessorMock = $ this ->createMock (
74
- \ Magento \ Catalog \ Model \ Indexer \ Product \ Price \ Processor::class
87
+ Processor::class
75
88
);
76
89
$ operationManagementMock = $ this ->createMock (
77
- \ Magento \ Framework \ Bulk \ OperationManagementInterface::class
90
+ OperationManagementInterface::class
78
91
);
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);
83
96
$ this ->model = $ this ->objectManager ->create (
84
97
Consumer::class,
85
98
[
0 commit comments