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 7
7
8
8
namespace Magento \Catalog \Controller \Adminhtml \Category ;
9
9
10
+ use Magento \Catalog \Helper \DefaultCategory ;
10
11
use Magento \TestFramework \TestCase \AbstractBackendController ;
11
12
12
13
/**
15
16
* @see \Magento\Catalog\Controller\Adminhtml\Category\Add
16
17
*
17
18
* @magentoAppArea adminhtml
19
+ * @magentoDbIsolation enabled
18
20
*/
19
21
class AddTest extends AbstractBackendController
20
22
{
21
23
/**
22
- * @var int
24
+ * @var DefaultCategory
23
25
*/
24
- const DEFAULT_ROOT_CATEGORY = 2 ;
26
+ private $ defaultCategoryHelper ;
25
27
26
28
/**
27
29
* @inheritdoc
@@ -30,13 +32,10 @@ protected function setUp(): void
30
32
{
31
33
parent ::setUp ();
32
34
33
- $ this ->getRequest ()-> setParams ([] );
35
+ $ this ->defaultCategoryHelper = $ this -> _objectManager -> get (DefaultCategory::class );
34
36
}
35
37
36
-
37
38
/**
38
- * @magentoDbIsolation enabled
39
- *
40
39
* @return void
41
40
*/
42
41
public function testExecuteWithoutParams (): void
@@ -46,14 +45,12 @@ public function testExecuteWithoutParams(): void
46
45
}
47
46
48
47
/**
49
- * @magentoDbIsolation enabled
50
- *
51
48
* @return void
52
49
*/
53
50
public function testExecuteAsAjax (): void
54
51
{
55
52
$ this ->getRequest ()->setQueryValue ('isAjax ' , true );
56
- $ this ->getRequest ()->setParam ('parent ' , self :: DEFAULT_ROOT_CATEGORY );
53
+ $ this ->getRequest ()->setParam ('parent ' , $ this -> defaultCategoryHelper -> getId () );
57
54
$ this ->dispatch ('backend/catalog/category/add ' );
58
55
$ this ->assertJson ($ this ->getResponse ()->getBody ());
59
56
}
You can’t perform that action at this time.
0 commit comments