10
10
use Magento \Framework \App \ResourceConnection ;
11
11
use Magento \Framework \DB \Ddl \Trigger ;
12
12
use Magento \Framework \DB \Ddl \TriggerFactory ;
13
+ use Magento \Framework \Indexer \Action \Dummy ;
13
14
use Magento \Framework \Mview \Config ;
14
- use Magento \Framework \Mview \View \CollectionInterface ;
15
- use Magento \Framework \Mview \View \Subscription ;
16
- use Magento \Framework \Mview \View \SubscriptionStatementPostprocessorInterface ;
15
+ use Magento \Framework \Mview \Config \Data ;
16
+ use Magento \Framework \Mview \View \AdditionalColumnsProcessor \DefaultProcessor ;
17
17
use Magento \Framework \Mview \ViewInterface ;
18
18
use Magento \TestFramework \Helper \Bootstrap ;
19
19
use PHPUnit \Framework \TestCase ;
@@ -81,37 +81,37 @@ protected function setUp(): void
81
81
'name ' => 'catalog_product_entity ' ,
82
82
'column ' => 'entity_id ' ,
83
83
'subscription_model ' => null ,
84
- 'processor ' => \ Magento \ Framework \ Mview \ View \ AdditionalColumnsProcessor \ DefaultProcessor::class
84
+ 'processor ' => DefaultProcessor::class
85
85
]
86
86
]);
87
87
88
88
// Create changelog for the view
89
- $ changelog = $ objectManager ->create (\ Magento \ Framework \ Mview \ View \ Changelog::class);
89
+ $ changelog = $ objectManager ->create (Changelog::class);
90
90
$ changelog ->setViewId ('test_view ' );
91
91
$ changelog ->create ();
92
92
93
93
// Set up view state
94
- $ state = $ objectManager ->create (\ Magento \ Framework \ Mview \ View \ StateInterface::class);
94
+ $ state = $ objectManager ->create (StateInterface::class);
95
95
$ state ->setViewId ('test_view ' )
96
- ->setMode (\ Magento \ Framework \ Mview \ View \ StateInterface::MODE_ENABLED )
97
- ->setStatus (\ Magento \ Framework \ Mview \ View \ StateInterface::STATUS_IDLE )
96
+ ->setMode (StateInterface::MODE_ENABLED )
97
+ ->setStatus (StateInterface::STATUS_IDLE )
98
98
->save ();
99
99
100
100
$ this ->view ->setState ($ state );
101
101
102
102
// Configure the view in Mview configuration
103
- $ configData = $ objectManager ->get (\ Magento \ Framework \ Mview \ Config \ Data::class);
103
+ $ configData = $ objectManager ->get (Data::class);
104
104
$ configData ->merge ([
105
105
'test_view ' => [
106
106
'view_id ' => 'test_view ' ,
107
- 'action_class ' => \ Magento \ Framework \ Indexer \ Action \ Dummy::class,
107
+ 'action_class ' => Dummy::class,
108
108
'group ' => 'indexer ' ,
109
109
'subscriptions ' => [
110
110
'catalog_product_entity ' => [
111
111
'name ' => 'catalog_product_entity ' ,
112
112
'column ' => 'entity_id ' ,
113
113
'subscription_model ' => null ,
114
- 'processor ' => \ Magento \ Framework \ Mview \ View \ AdditionalColumnsProcessor \ DefaultProcessor::class
114
+ 'processor ' => DefaultProcessor::class
115
115
]
116
116
]
117
117
]
@@ -160,7 +160,7 @@ public function testCreateTriggers(): void
160
160
// Verify triggers were created
161
161
$ connection = $ this ->resource ->getConnection ();
162
162
$ triggers = $ this ->subscription ->getTriggers ();
163
-
163
+
164
164
foreach ($ triggers as $ trigger ) {
165
165
$ triggerName = $ trigger ->getName ();
166
166
$ result = $ connection ->fetchOne (
@@ -181,7 +181,7 @@ public function testRemoveTriggers(): void
181
181
{
182
182
// First create triggers
183
183
$ this ->subscription ->create ();
184
-
184
+
185
185
// Get trigger names before removal
186
186
$ triggers = $ this ->subscription ->getTriggers ();
187
187
$ triggerNames = array_map (function ($ trigger ) {
@@ -208,7 +208,7 @@ public function testTriggerStatementsWithIgnoredColumns(): void
208
208
{
209
209
$ this ->subscription ->create ();
210
210
$ triggers = $ this ->subscription ->getTriggers ();
211
-
211
+
212
212
// Find the UPDATE trigger
213
213
$ updateTrigger = null ;
214
214
foreach ($ triggers as $ trigger ) {
@@ -219,11 +219,11 @@ public function testTriggerStatementsWithIgnoredColumns(): void
219
219
}
220
220
221
221
$ this ->assertNotNull ($ updateTrigger , 'UPDATE trigger not found ' );
222
-
222
+
223
223
// Verify the trigger statements contain the ignored column check
224
224
$ statements = $ updateTrigger ->getStatements ();
225
225
$ this ->assertNotEmpty ($ statements , 'Trigger has no statements ' );
226
-
226
+
227
227
// Check that updated_at is NOT in the list of columns being checked
228
228
$ hasIgnoredColumnCheck = true ;
229
229
foreach ($ statements as $ statement ) {
@@ -232,7 +232,7 @@ public function testTriggerStatementsWithIgnoredColumns(): void
232
232
break ;
233
233
}
234
234
}
235
-
235
+
236
236
$ this ->assertTrue (
237
237
$ hasIgnoredColumnCheck ,
238
238
'Trigger contains check for ignored column '
0 commit comments