File tree Expand file tree Collapse file tree 6 files changed +99
-9
lines changed
dev/tests/integration/testsuite/Magento
Catalog/Controller/Adminhtml/Product/Save
ConfigurableProduct/Controller/Adminhtml/Product/Save Expand file tree Collapse file tree 6 files changed +99
-9
lines changed Original file line number Diff line number Diff line change 19
19
*
20
20
* @magentoAppArea adminhtml
21
21
* @magentoDbIsolation enabled
22
+ * @magentoDataFixture Magento/Catalog/_files/product_without_options.php
22
23
*/
23
24
class CreateCustomOptionsTest extends AbstractBackendController
24
25
{
26
+ /**
27
+ * @var string
28
+ */
29
+ protected $ productSku = 'simple ' ;
30
+
25
31
/**
26
32
* @var ProductRepositoryInterface
27
33
*/
@@ -46,8 +52,6 @@ protected function setUp()
46
52
/**
47
53
* Test add to product custom option with type "field".
48
54
*
49
- * @magentoDataFixture Magento/Catalog/_files/product_without_options.php
50
- *
51
55
* @dataProvider productWithNewOptionsDataProvider
52
56
*
53
57
* @param array $productPostData
@@ -57,7 +61,7 @@ protected function setUp()
57
61
public function testSaveCustomOptionWithTypeField (array $ productPostData ): void
58
62
{
59
63
$ this ->getRequest ()->setPostValue ($ productPostData );
60
- $ product = $ this ->productRepository ->get (' simple ' );
64
+ $ product = $ this ->productRepository ->get ($ this -> productSku );
61
65
$ this ->getRequest ()->setMethod (HttpRequest::METHOD_POST );
62
66
$ this ->dispatch ('backend/catalog/product/save/id/ ' . $ product ->getEntityId ());
63
67
$ this ->assertSessionMessages (
Original file line number Diff line number Diff line change 21
21
*
22
22
* @magentoAppArea adminhtml
23
23
* @magentoDbIsolation enabled
24
+ * @magentoDataFixture Magento/Catalog/_files/product_without_options.php
24
25
*/
25
26
class DeleteCustomOptionsTest extends AbstractBackendController
26
27
{
28
+ /**
29
+ * @var string
30
+ */
31
+ protected $ productSku = 'simple ' ;
32
+
27
33
/**
28
34
* @var ProductRepositoryInterface
29
35
*/
@@ -54,16 +60,14 @@ protected function setUp()
54
60
/**
55
61
* Test delete custom option with type "field".
56
62
*
57
- * @magentoDataFixture Magento/Catalog/_files/product_without_options.php
58
- *
59
63
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Option\DataProvider\Type\Field::getDataForCreateOptions
60
64
*
61
65
* @param array $optionData
62
66
* @return void
63
67
*/
64
68
public function testDeleteCustomOptionWithTypeField (array $ optionData ): void
65
69
{
66
- $ product = $ this ->productRepository ->get (' simple ' );
70
+ $ product = $ this ->productRepository ->get ($ this -> productSku );
67
71
/** @var ProductCustomOptionInterface $option */
68
72
$ option = $ this ->optionRepositoryFactory ->create (['data ' => $ optionData ]);
69
73
$ option ->setProductSku ($ product ->getSku ());
Original file line number Diff line number Diff line change 22
22
*
23
23
* @magentoAppArea adminhtml
24
24
* @magentoDbIsolation enabled
25
+ * @magentoDataFixture Magento/Catalog/_files/product_without_options.php
25
26
*/
26
27
class UpdateCustomOptionsTest extends AbstractBackendController
27
28
{
29
+ /**
30
+ * @var string
31
+ */
32
+ protected $ productSku = 'simple ' ;
33
+
28
34
/**
29
35
* @var ProductRepositoryInterface
30
36
*/
@@ -55,8 +61,6 @@ protected function setUp()
55
61
/**
56
62
* Test add to product custom option with type "field".
57
63
*
58
- * @magentoDataFixture Magento/Catalog/_files/product_without_options.php
59
- *
60
64
* @dataProvider \Magento\TestFramework\Catalog\Model\Product\Option\DataProvider\Type\Field::getDataForUpdateOptions
61
65
*
62
66
* @param array $optionData
@@ -65,7 +69,7 @@ protected function setUp()
65
69
*/
66
70
public function testUpdateCustomOptionWithTypeField (array $ optionData , array $ updateData ): void
67
71
{
68
- $ product = $ this ->productRepository ->get (' simple ' );
72
+ $ product = $ this ->productRepository ->get ($ this -> productSku );
69
73
/** @var ProductCustomOptionInterface|Option $option */
70
74
$ option = $ this ->optionRepositoryFactory ->create (['data ' => $ optionData ]);
71
75
$ option ->setProductSku ($ product ->getSku ());
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \ConfigurableProduct \Controller \Adminhtml \Product \Save ;
9
+
10
+ use Magento \Catalog \Controller \Adminhtml \Product \Save \CreateCustomOptionsTest as SimpleProductOptionsTest ;
11
+
12
+ /**
13
+ * Base test cases for configurable product custom options with type "field".
14
+ * Option add via dispatch product controller action save with options data in POST data.
15
+ *
16
+ * @magentoAppArea adminhtml
17
+ * @magentoDbIsolation enabled
18
+ * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
19
+ */
20
+ class CreateCustomOptionsTest extends SimpleProductOptionsTest
21
+ {
22
+ /**
23
+ * @var string
24
+ */
25
+ protected $ productSku = 'configurable ' ;
26
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \ConfigurableProduct \Controller \Adminhtml \Product \Save ;
9
+
10
+ use Magento \Catalog \Controller \Adminhtml \Product \Save \DeleteCustomOptionsTest as SimpleProductOptionsTest ;
11
+
12
+ /**
13
+ * Base test cases for delete configurable product custom option with type "field".
14
+ * Option deleting via product controller action save.
15
+ *
16
+ * @magentoAppArea adminhtml
17
+ * @magentoDbIsolation enabled
18
+ * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
19
+ */
20
+ class DeleteCustomOptionsTest extends SimpleProductOptionsTest
21
+ {
22
+ /**
23
+ * @var string
24
+ */
25
+ protected $ productSku = 'configurable ' ;
26
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \ConfigurableProduct \Controller \Adminhtml \Product \Save ;
9
+
10
+ use Magento \Catalog \Controller \Adminhtml \Product \Save \UpdateCustomOptionsTest as SimpleProductOptionsTest ;
11
+
12
+ /**
13
+ * Base test cases for update configurable product custom options with type "field".
14
+ * Option updating via dispatch product controller action save with updated options data in POST data.
15
+ *
16
+ * @magentoAppArea adminhtml
17
+ * @magentoDbIsolation enabled
18
+ * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
19
+ */
20
+ class UpdateCustomOptionsTest extends SimpleProductOptionsTest
21
+ {
22
+ /**
23
+ * @var string
24
+ */
25
+ protected $ productSku = 'configurable ' ;
26
+ }
You can’t perform that action at this time.
0 commit comments