File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 77
88namespace Magento \Catalog \Controller \Adminhtml \Category ;
99
10+ use Magento \Catalog \Helper \DefaultCategory ;
1011use Magento \TestFramework \TestCase \AbstractBackendController ;
1112
1213/**
1516 * @see \Magento\Catalog\Controller\Adminhtml\Category\Add
1617 *
1718 * @magentoAppArea adminhtml
19+ * @magentoDbIsolation enabled
1820 */
1921class AddTest extends AbstractBackendController
2022{
2123 /**
22- * @var int
24+ * @var DefaultCategory
2325 */
24- const DEFAULT_ROOT_CATEGORY = 2 ;
26+ private $ defaultCategoryHelper ;
2527
2628 /**
2729 * @inheritdoc
@@ -30,13 +32,10 @@ protected function setUp(): void
3032 {
3133 parent ::setUp ();
3234
33- $ this ->getRequest ()-> setParams ([] );
35+ $ this ->defaultCategoryHelper = $ this -> _objectManager -> get (DefaultCategory::class );
3436 }
3537
36-
3738 /**
38- * @magentoDbIsolation enabled
39- *
4039 * @return void
4140 */
4241 public function testExecuteWithoutParams (): void
@@ -46,14 +45,12 @@ public function testExecuteWithoutParams(): void
4645 }
4746
4847 /**
49- * @magentoDbIsolation enabled
50- *
5148 * @return void
5249 */
5350 public function testExecuteAsAjax (): void
5451 {
5552 $ this ->getRequest ()->setQueryValue ('isAjax ' , true );
56- $ this ->getRequest ()->setParam ('parent ' , self :: DEFAULT_ROOT_CATEGORY );
53+ $ this ->getRequest ()->setParam ('parent ' , $ this -> defaultCategoryHelper -> getId () );
5754 $ this ->dispatch ('backend/catalog/category/add ' );
5855 $ this ->assertJson ($ this ->getResponse ()->getBody ());
5956 }
You can’t perform that action at this time.
0 commit comments