File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
dev/tests/integration/testsuite/Magento/Catalog/_files Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change 24
24
$ categoryRepository = $ objectManager ->get (CategoryRepositoryInterface::class);
25
25
$ currentStoreId = $ storeManager ->getStore ()->getId ();
26
26
27
- try {
28
- $ storeManager ->setCurrentStore (Store::DEFAULT_STORE_ID );
29
- $ category = $ categoryFactory ->create ();
30
- $ category ->isObjectNew (true );
31
- $ category ->setName ('Category 999 ' )
32
- ->setParentId (2 )
33
- ->setLevel (2 )
34
- ->setAvailableSortBy ('name ' )
35
- ->setDefaultSortBy ('name ' )
36
- ->setIsActive (true )
37
- ->setPosition (1 );
38
- $ category = $ categoryRepository ->save ($ category );
39
- } finally {
40
- $ storeManager ->setCurrentStore ($ currentStoreId );
41
- }
27
+ $ storeManager ->setCurrentStore (Store::DEFAULT_STORE_ID );
28
+ $ category = $ categoryFactory ->create ();
29
+ $ category ->isObjectNew (true );
30
+ $ category ->setName ('Category 999 ' )
31
+ ->setParentId (2 )
32
+ ->setLevel (2 )
33
+ ->setAvailableSortBy ('name ' )
34
+ ->setDefaultSortBy ('name ' )
35
+ ->setIsActive (true )
36
+ ->setPosition (1 );
37
+ $ category = $ categoryRepository ->save ($ category );
38
+ $ storeManager ->setCurrentStore ($ currentStoreId );
42
39
43
40
$ product = $ productFactory ->create ();
44
41
$ product ->setTypeId (Type::TYPE_SIMPLE )
You can’t perform that action at this time.
0 commit comments