@@ -93,55 +93,65 @@ protected function setUp()
93
93
->getMock ();
94
94
$ this ->clientConfig = $ this ->getMockBuilder (\Magento \Elasticsearch \Model \Config::class)
95
95
->disableOriginalConstructor ()
96
- ->setMethods ([
97
- 'getIndexPrefix ' ,
98
- 'getEntityType ' ,
99
- ])->getMock ();
96
+ ->setMethods (
97
+ [
98
+ 'getIndexPrefix ' ,
99
+ 'getEntityType ' ,
100
+ ]
101
+ )->getMock ();
100
102
$ this ->indexBuilder = $ this ->getMockBuilder (\Magento \Elasticsearch \Model \Adapter \Index \BuilderInterface::class)
101
103
->disableOriginalConstructor ()
102
104
->getMock ();
103
105
$ this ->logger = $ this ->getMockBuilder (\Psr \Log \LoggerInterface::class)
104
106
->disableOriginalConstructor ()
105
107
->getMock ();
106
108
$ elasticsearchClientMock = $ this ->getMockBuilder (\Elasticsearch \Client::class)
107
- ->setMethods ([
108
- 'indices ' ,
109
- 'ping ' ,
110
- 'bulk ' ,
111
- 'search ' ,
112
- ])
109
+ ->setMethods (
110
+ [
111
+ 'indices ' ,
112
+ 'ping ' ,
113
+ 'bulk ' ,
114
+ 'search ' ,
115
+ ]
116
+ )
113
117
->disableOriginalConstructor ()
114
118
->getMock ();
115
119
$ indicesMock = $ this ->getMockBuilder (\Elasticsearch \Namespaces \IndicesNamespace::class)
116
- ->setMethods ([
117
- 'exists ' ,
118
- 'getSettings ' ,
119
- 'create ' ,
120
- 'putMapping ' ,
121
- 'deleteMapping ' ,
122
- 'existsAlias ' ,
123
- 'updateAliases ' ,
124
- 'stats '
125
- ])
120
+ ->setMethods (
121
+ [
122
+ 'exists ' ,
123
+ 'getSettings ' ,
124
+ 'create ' ,
125
+ 'putMapping ' ,
126
+ 'deleteMapping ' ,
127
+ 'existsAlias ' ,
128
+ 'updateAliases ' ,
129
+ 'stats '
130
+ ]
131
+ )
126
132
->disableOriginalConstructor ()
127
133
->getMock ();
128
134
$ elasticsearchClientMock ->expects ($ this ->any ())
129
135
->method ('indices ' )
130
136
->willReturn ($ indicesMock );
131
137
$ this ->client = $ this ->getMockBuilder (\Magento \Elasticsearch \Model \Client \Elasticsearch::class)
132
- ->setConstructorArgs ([
133
- 'options ' => $ this ->getClientOptions (),
134
- 'elasticsearchClient ' => $ elasticsearchClientMock
135
- ])
138
+ ->setConstructorArgs (
139
+ [
140
+ 'options ' => $ this ->getClientOptions (),
141
+ 'elasticsearchClient ' => $ elasticsearchClientMock
142
+ ]
143
+ )
136
144
->getMock ();
137
145
$ this ->connectionManager ->expects ($ this ->any ())
138
146
->method ('getConnection ' )
139
147
->willReturn ($ this ->client );
140
148
$ this ->fieldMapper ->expects ($ this ->any ())
141
149
->method ('getAllAttributesTypes ' )
142
- ->willReturn ([
143
- 'name ' => 'string ' ,
144
- ]);
150
+ ->willReturn (
151
+ [
152
+ 'name ' => 'string ' ,
153
+ ]
154
+ );
145
155
$ this ->clientConfig ->expects ($ this ->any ())
146
156
->method ('getIndexPrefix ' )
147
157
->willReturn ('indexName ' );
@@ -151,12 +161,14 @@ protected function setUp()
151
161
$ this ->indexNameResolver = $ this ->getMockBuilder (
152
162
\Magento \Elasticsearch \Model \Adapter \Index \IndexNameResolver::class
153
163
)
154
- ->setMethods ([
155
- 'getIndexName ' ,
156
- 'getIndexNamespace ' ,
157
- 'getIndexFromAlias ' ,
158
- 'getIndexNameForAlias ' ,
159
- ])
164
+ ->setMethods (
165
+ [
166
+ 'getIndexName ' ,
167
+ 'getIndexNamespace ' ,
168
+ 'getIndexFromAlias ' ,
169
+ 'getIndexNameForAlias ' ,
170
+ ]
171
+ )
160
172
->disableOriginalConstructor ()
161
173
->getMock ();
162
174
$ this ->batchDocumentDataMapper = $ this ->getMockBuilder (
@@ -216,9 +228,11 @@ public function testPrepareDocsPerStore()
216
228
{
217
229
$ this ->batchDocumentDataMapper ->expects ($ this ->once ())
218
230
->method ('map ' )
219
- ->willReturn ([
220
- 'name ' => 'Product Name ' ,
221
- ]);
231
+ ->willReturn (
232
+ [
233
+ 'name ' => 'Product Name ' ,
234
+ ]
235
+ );
222
236
$ this ->assertInternalType (
223
237
'array ' ,
224
238
$ this ->model ->prepareDocsPerStore (
@@ -352,9 +366,11 @@ public function testConnectException()
352
366
{
353
367
$ connectionManager = $ this ->getMockBuilder (\Magento \Elasticsearch \SearchAdapter \ConnectionManager::class)
354
368
->disableOriginalConstructor ()
355
- ->setMethods ([
356
- 'getConnection ' ,
357
- ])
369
+ ->setMethods (
370
+ [
371
+ 'getConnection ' ,
372
+ ]
373
+ )
358
374
->getMock ();
359
375
360
376
$ connectionManager ->expects ($ this ->any ())
0 commit comments