Skip to content

Commit 9df49a6

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento-engcom/magento2ce#1362: [EngCom Team] Batch 34. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1361: [EngCom Team] Batch 33. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1342: [EngCom Team] Batch 27. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1359: [EngCom Team] Batch 32. Forwardports to 2.3-develop (by @magento-engcom-team) Fixed GitHub Issues: - #5035: I can not to subscribe on change of all sections in Stores ->Configuration using event admin_system_config_changed_section (reported by @katesuykovskaya) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - #9055: Default Store is always used when retrieving sequence value's for sales entity's. (reported by @reztierk) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - #10438: Potential error on order edit page when address has extension attributes (reported by @dankocherga) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - #12699: Multiselect Attribute is not saved for a product in the admin panel when it has a related product using another attribute set (reported by @bmisyura) has been fixed in magento-engcom/magento2ce#1362 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 4705e23 2. 6d355e0 3. 77f34cf 4. 748ab4d 5. 90f9d95 6. 44ca24f 7. f0b7f2b 8. c3e1d93 9. 4810755 10. 4709a22 11. a2b9fab 12. ac7df33 13. 245238d 14. 2c153c3 15. 48a72fa 16. 625f685 17. afa4516 - #9036: Database backup doesn't include triggers (reported by @domeglic) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #9918: Magento 2 automatically disables maintenance mode after certain actions (reported by @royvanos) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #10697: Product Import: Additional data: Invalid URL key (reported by @Alex-James17) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #11332: How to Fix the wrong input format of Customer date of birth (reported by @selusi) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #11796: Magento2.2.0 home page product grid issues (reported by @losetemp) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #12064: Database Rollback not working with magento 2.1.9? (reported by @whereowareadmin) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #12127: Apostrophe in attribute option value in admin is not handled properly (reported by @erfanimani) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #12446: Remove /home from the sitemap.xml (reported by @wd7080) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #12714: Extra records are in exported CSV file for order (reported by @alena-marchenko) has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 716f9af 2. 595527a 3. 8c05a29 4. 63958cd 5. 78c2c21 6. 7f2dc29 7. aee7458 8. 92f8586 9. bf178ca 10. ecafa80 11. a15208e 12. 76716b8 13. 490785f 14. 6fe6280 15. 33e40ec 16. 7b1bec8 17. dbe5fc7 18. 22c6937 19. ca7da3f 20. b55a5d1 21. 65b745f 22. b0a5a52 23. 97dd9ad 24. aa28366 25. 0fc86d8 26. f11994a 27. 04445d0 - #12828: Uncaught Error: Script error for: trackingCode error on every frontend page (reported by @poojawebkul) has been fixed in magento-engcom/magento2ce#1342 by @magento-engcom-team in 2.3-develop branch Related commits: 1. aa93f83 2. 0b76fcd 3. be77fdd 4. 4bad8be 5. 59e1020 6. ef63b3a 7. a278aaf 8. f7c00d7 9. f1ecb11 10. 74aabb4 11. 1d66e5e 12. dc4977d 13. 99f982c 14. 76c4f0d 15. 9e2cc5e 16. 82d488b - #5774: Tier price and custom options give bad results (reported by @yangsystem) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - #6916: Update Bundle Product without changes in bundle items (reported by @magecodenet) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - #9277: Create new CLI command: enable/disable Magento Profiler (reported by @vrann) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - #10133: Please add your expectations for @deprecated annotations (reported by @flancer64) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - #11792: Can't add customizable options to product (reported by @mikelevy300) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - #12374: Model hasDataChanges always true (reported by @Detzler) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - #12430: While assigning prices to configurable products, prices aren's readable when using custom price symbol. (reported by @quisse) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5 - #12705: Integrity constraint violation error after reordering product with custom options (reported by @alena-marchenko) has been fixed in magento-engcom/magento2ce#1359 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 1db3f8f 2. 412d228 3. 02620b0 4. 57c5d8a 5. 94a3f03 6. 0d557dc 7. 48baf59 8. dc3bb78 9. 0ab4533 10. 00f64b0 11. 440a1b5 12. 4ed8f5b 13. 656eeb5 14. fd2f731 15. 2c1a23f 16. f7ff71a 17. ac9bcfa 18. 55debe0 19. 3495086 20. d678f15 21. bf8ee30 22. 335c91c 23. c5a823f 24. 696a5a5
2 parents ec39184 + b06928d commit 9df49a6

File tree

98 files changed

+2817
-969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2817
-969
lines changed

COPYING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2013-2017 Magento, Inc.
1+
Copyright © 2013-2018 Magento, Inc.
22

33
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license
44

app/bootstrap.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@
4949
unset($_SERVER['ORIG_PATH_INFO']);
5050
}
5151

52-
if (!empty($_SERVER['MAGE_PROFILER'])
52+
if (
53+
(!empty($_SERVER['MAGE_PROFILER']) || file_exists(BP . '/var/profiler.flag'))
5354
&& isset($_SERVER['HTTP_ACCEPT'])
5455
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
5556
) {
5657
\Magento\Framework\Profiler::applyConfig(
57-
$_SERVER['MAGE_PROFILER'],
58+
(isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])) ? $_SERVER['MAGE_PROFILER'] : trim(file_get_contents(BP . '/var/profiler.flag')),
5859
BP,
5960
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
6061
);

app/code/Magento/Backup/Model/Db.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public function createBackup(\Magento\Framework\Backup\Db\BackupInterface $backu
173173
}
174174
}
175175
$backup->write($this->getResource()->getTableForeignKeysSql());
176+
$backup->write($this->getResource()->getTableTriggersSql());
176177
$backup->write($this->getResource()->getFooter());
177178

178179
$this->getResource()->commitTransaction();

app/code/Magento/Backup/Model/ResourceModel/Db.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,31 @@ public function getTableForeignKeysSql($tableName = null)
114114
return $fkScript;
115115
}
116116

117+
/**
118+
* Return triggers for table(s).
119+
*
120+
* @param string|null $tableName
121+
* @param bool $addDropIfExists
122+
* @return string
123+
*/
124+
public function getTableTriggersSql($tableName = null, $addDropIfExists = true)
125+
{
126+
$triggerScript = '';
127+
if (!$tableName) {
128+
$tables = $this->getTables();
129+
foreach ($tables as $table) {
130+
$tableTriggerScript = $this->_resourceHelper->getTableTriggersSql($table, $addDropIfExists);
131+
if (!empty($tableTriggerScript)) {
132+
$triggerScript .= "\n" . $tableTriggerScript;
133+
}
134+
}
135+
} else {
136+
$triggerScript = $this->getTableTriggersSql($tableName, $addDropIfExists);
137+
}
138+
139+
return $triggerScript;
140+
}
141+
117142
/**
118143
* Retrieve table status
119144
*

app/code/Magento/Backup/Model/ResourceModel/Helper.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,40 @@ public function restoreTransactionIsolationLevel()
337337
{
338338
$this->getConnection()->query('SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
339339
}
340+
341+
/**
342+
* Get create script for triggers.
343+
*
344+
* @param string $tableName
345+
* @param boolean $addDropIfExists
346+
* @param boolean $stripDefiner
347+
* @return string
348+
*/
349+
public function getTableTriggersSql($tableName, $addDropIfExists = false, $stripDefiner = true)
350+
{
351+
$script = "--\n-- Triggers structure for table `{$tableName}`\n--\n";
352+
$triggers = $this->getConnection()->query('SHOW TRIGGERS LIKE \''. $tableName . '\'')->fetchAll();
353+
354+
if (!$triggers) {
355+
return '';
356+
}
357+
foreach ($triggers as $trigger) {
358+
if ($addDropIfExists) {
359+
$script .= 'DROP TRIGGER IF EXISTS ' . $trigger['Trigger'] . ";\n";
360+
}
361+
$script .= "delimiter ;;\n";
362+
363+
$triggerData = $this->getConnection()->query('SHOW CREATE TRIGGER '. $trigger['Trigger'])->fetch();
364+
if ($stripDefiner) {
365+
$cleanedScript = preg_replace('/DEFINER=[^\s]*/', '', $triggerData['SQL Original Statement']);
366+
$script .= $cleanedScript . "\n";
367+
} else {
368+
$script .= $triggerData['SQL Original Statement'] . "\n";
369+
}
370+
$script .= ";;\n";
371+
$script .= "delimiter ;\n";
372+
}
373+
374+
return $script;
375+
}
340376
}

app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected function processBundleOptionsData(\Magento\Catalog\Model\Product $prod
127127
}
128128
$options = [];
129129
foreach ($bundleOptionsData as $key => $optionData) {
130-
if ((bool)$optionData['delete']) {
130+
if (!empty($optionData['delete'])) {
131131
continue;
132132
}
133133

app/code/Magento/Bundle/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/BundleTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ protected function setUp()
5757
'setOptions',
5858
'setCanSaveBundleSelections',
5959
'__wakeup',
60-
'getOptionsReadonly'
60+
'getOptionsReadonly',
61+
'getBundleOptionsData',
62+
'getExtensionAttributes',
63+
'setExtensionAttributes',
6164
];
6265
$this->productMock = $this->createPartialMock(\Magento\Catalog\Model\Product::class, $methods);
6366
$optionInterfaceFactory = $this->getMockBuilder(\Magento\Bundle\Api\Data\OptionInterfaceFactory::class)
@@ -127,6 +130,17 @@ public function testAfterInitializeIfBundleAnsCustomOptionsAndBundleSelectionsEx
127130
);
128131
$this->productMock->expects($this->once())->method('setOptions')->with(null);
129132
$this->productMock->expects($this->once())->method('setCanSaveBundleSelections')->with(true);
133+
$this->productMock->expects($this->once())
134+
->method('getBundleOptionsData')
135+
->willReturn(['option_1' => ['delete' => 1]]);
136+
$extentionAttribute = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductExtensionInterface::class)
137+
->disableOriginalConstructor()
138+
->setMethods(['setBundleProductOptions'])
139+
->getMockForAbstractClass();
140+
$extentionAttribute->expects($this->once())->method('setBundleProductOptions')->with([]);
141+
$this->productMock->expects($this->once())->method('getExtensionAttributes')->willReturn($extentionAttribute);
142+
$this->productMock->expects($this->once())->method('setExtensionAttributes')->with($extentionAttribute);
143+
130144
$this->model->afterInitialize($this->subjectMock, $this->productMock);
131145
}
132146

app/code/Magento/Catalog/Model/Product/Option/Value.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Catalog\Model\Product;
1010
use Magento\Catalog\Model\Product\Option;
11+
use Magento\Catalog\Pricing\Price\BasePrice;
1112
use Magento\Framework\Model\AbstractModel;
1213

1314
/**
@@ -222,7 +223,7 @@ public function saveValues()
222223
public function getPrice($flag = false)
223224
{
224225
if ($flag && $this->getPriceType() == self::TYPE_PERCENT) {
225-
$basePrice = $this->getOption()->getProduct()->getFinalPrice();
226+
$basePrice = $this->getOption()->getProduct()->getPriceInfo()->getPrice(BasePrice::PRICE_CODE)->getValue();
226227
$price = $basePrice * ($this->_getData(self::KEY_PRICE) / 100);
227228
return $price;
228229
}

app/code/Magento/Catalog/Test/Unit/Model/Product/Option/ValueTest.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ private function getMockedValueCollectionFactory()
104104

105105
$mockBuilder =
106106
$this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Option\Value\CollectionFactory::class)
107-
->setMethods(['create'])
108-
->disableOriginalConstructor();
107+
->setMethods(['create'])
108+
->disableOriginalConstructor();
109109
$mock = $mockBuilder->getMock();
110110

111111
$mock->expects($this->any())
@@ -164,13 +164,27 @@ private function getMockedOption()
164164
private function getMockedProduct()
165165
{
166166
$mockBuilder = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
167-
->setMethods(['getFinalPrice', '__wakeup'])
167+
->setMethods(['getPriceInfo', '__wakeup'])
168168
->disableOriginalConstructor();
169169
$mock = $mockBuilder->getMock();
170170

171-
$mock->expects($this->any())
172-
->method('getFinalPrice')
173-
->will($this->returnValue(10));
171+
$priceInfoMock = $this->getMockForAbstractClass(
172+
\Magento\Framework\Pricing\PriceInfoInterface::class,
173+
[],
174+
'',
175+
false,
176+
false,
177+
true,
178+
['getPrice']
179+
);
180+
181+
$priceMock = $this->getMockForAbstractClass(\Magento\Framework\Pricing\Price\PriceInterface::class);
182+
183+
$priceInfoMock->expects($this->any())->method('getPrice')->willReturn($priceMock);
184+
185+
$mock->expects($this->any())->method('getPriceInfo')->willReturn($priceInfoMock);
186+
187+
$priceMock->expects($this->any())->method('getValue')->willReturn(10);
174188

175189
return $mock;
176190
}

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/AbstractTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ public function testWalkAttributes()
4444

4545
$code = 'test_attr';
4646
$set = 10;
47+
$storeId = 100;
4748

4849
$object = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['__wakeup']);
4950

5051
$object->setData('test_attr', 'test_attr');
5152
$object->setData('attribute_set_id', $set);
53+
$object->setData('store_id', $storeId);
5254

5355
$entityType = new \Magento\Framework\DataObject();
5456
$entityType->setEntityTypeCode('test');

0 commit comments

Comments
 (0)