File tree Expand file tree Collapse file tree 2 files changed +6
-28
lines changed
dev/tests/integration/testsuite/Magento/Catalog
Controller/Adminhtml/Product/Set Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,9 @@ public function testRemoveAttributeFromAttributeSet()
172
172
$ product ->setAttributeSetId ($ attributeSet ->getId ());
173
173
$ product = $ this ->productRepository ->save ($ product );
174
174
$ this ->dispatch ('backend/catalog/product/edit/id/ ' . $ product ->getEntityId ());
175
- $ this ->assertNotContains ($ message , $ this ->getSyslogContent ());
175
+ $ syslogPath = $ this ->getSyslogPath ();
176
+ $ syslogContent = file_exists ($ syslogPath ) ? file_get_contents ($ syslogPath ) : '' ;
177
+ $ this ->assertNotContains ($ message , $ syslogContent );
176
178
}
177
179
178
180
/**
@@ -200,33 +202,9 @@ private function getSyslogPath()
200
202
*/
201
203
private function removeSyslog ()
202
204
{
203
- $ this ->detachLogger ();
205
+ $ this ->syslogHandler -> close ();
204
206
if (file_exists ($ this ->getSyslogPath ())) {
205
207
unlink ($ this ->getSyslogPath ());
206
208
}
207
209
}
208
-
209
- /**
210
- * Detach system log handler.
211
- *
212
- * @return void
213
- */
214
- private function detachLogger ()
215
- {
216
- $ this ->syslogHandler ->close ();
217
- }
218
-
219
- /**
220
- * Retrieve content of system.log file
221
- *
222
- * @return bool|string
223
- */
224
- private function getSyslogContent ()
225
- {
226
- if (!file_exists ($ this ->getSyslogPath ())) {
227
- return '' ;
228
- }
229
-
230
- return file_get_contents ($ this ->getSyslogPath ());
231
- }
232
210
}
Original file line number Diff line number Diff line change 9
9
$ entityType = $ objectManager ->create (\Magento \Eav \Model \Entity \Type::class)->loadByCode ('catalog_product ' );
10
10
11
11
$ attributeSetCollection = $ objectManager ->create (
12
- \Magento \Eav \Model \ResourceModel \Entity \Attribute \Set \Collection ::class
13
- );
12
+ \Magento \Eav \Model \ResourceModel \Entity \Attribute \Set \CollectionFactory ::class
13
+ )-> create () ;
14
14
$ attributeSetCollection ->addFilter ('attribute_set_name ' , 'new_attribute_set ' );
15
15
$ attributeSetCollection ->addFilter ('entity_type_id ' , $ entityType ->getId ());
16
16
$ attributeSetCollection ->setOrder ('attribute_set_id ' );
You can’t perform that action at this time.
0 commit comments