-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #17642: Change error message about low stock (by @vkublytskyi) - #17620: [Forwardport] Fix type error in Cart/Totals. (by @nmalevanec) - #17598: [Forwardport] Introduce Block Config Source (by @thomas-blackbird) - #17607: [Forwardport] 6305 - Resolved product custom option title save issue (by @jignesh-baldha) - #17232: Improve code quality subscriber new action (by @arnoudhgz) - #17574: [Forwardport] Solution for User role issue with customer group (by @jignesh-baldha) - magento/graphql-ce#138: Corrected field descriptions (by @keharper) Fixed GitHub Issues: - #12819: CartTotalRepository cannot handle extension attributes in quote addresses in 2.2.2 (reported by @marius-bica) has been fixed in #17620 by @nmalevanec in 2.3-develop branch Related commits: 1. 370dc84 - #12993: Type error in Cart/Totals (reported by @andrewhowdencom) has been fixed in #17620 by @nmalevanec in 2.3-develop branch Related commits: 1. 370dc84 - #6305: Can't save Customizable options (reported by @bachlee89) has been fixed in #17607 by @jignesh-baldha in 2.3-develop branch Related commits: 1. d60b3cf 2. 71ce3fa 3. 170d029 4. 6aebfe8 - #16499: User role issue with customer group (reported by @emiprotech) has been fixed in #17574 by @jignesh-baldha in 2.3-develop branch Related commits: 1. 0d7dc6c
- Loading branch information
Showing
19 changed files
with
216 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Cms\Model\Config\Source; | ||
|
||
use Magento\Cms\Model\ResourceModel\Block\CollectionFactory; | ||
use Magento\Framework\Data\OptionSourceInterface; | ||
|
||
/** | ||
* Class Block | ||
*/ | ||
class Block implements OptionSourceInterface | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $options; | ||
|
||
/** | ||
* @var \Magento\Cms\Model\ResourceModel\Block\CollectionFactory | ||
*/ | ||
private $collectionFactory; | ||
|
||
/** | ||
* @param \Magento\Cms\Model\ResourceModel\Block\CollectionFactory $collectionFactory | ||
*/ | ||
public function __construct( | ||
CollectionFactory $collectionFactory | ||
) { | ||
$this->collectionFactory = $collectionFactory; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
if (!$this->options) { | ||
$this->options = $this->collectionFactory->create()->toOptionIdArray(); | ||
} | ||
|
||
return $this->options; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
app/code/Magento/Cms/Test/Unit/Model/Config/Source/BlockTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Cms\Test\Unit\Model\Config\Source; | ||
|
||
/** | ||
* Class BlockTest | ||
*/ | ||
class BlockTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
/** | ||
* @var \Magento\Cms\Model\ResourceModel\Block\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $collectionFactory; | ||
|
||
/** | ||
* @var \Magento\Cms\Model\Config\Source\Block | ||
*/ | ||
protected $block; | ||
|
||
/** | ||
* Set up | ||
* | ||
* @return void | ||
*/ | ||
protected function setUp() | ||
{ | ||
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); | ||
|
||
$this->collectionFactory = $this->createPartialMock( | ||
\Magento\Cms\Model\ResourceModel\Block\CollectionFactory::class, | ||
['create'] | ||
); | ||
|
||
$this->block = $objectManager->getObject( | ||
\Magento\Cms\Model\Config\Source\Block::class, | ||
[ | ||
'collectionFactory' => $this->collectionFactory, | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Run test toOptionArray method | ||
* | ||
* @return void | ||
*/ | ||
public function testToOptionArray() | ||
{ | ||
$blockCollectionMock = $this->createMock(\Magento\Cms\Model\ResourceModel\Block\Collection::class); | ||
|
||
$this->collectionFactory->expects($this->once()) | ||
->method('create') | ||
->will($this->returnValue($blockCollectionMock)); | ||
|
||
$blockCollectionMock->expects($this->once()) | ||
->method('toOptionIdArray') | ||
->will($this->returnValue('return-value')); | ||
|
||
$this->assertEquals('return-value', $this->block->toOptionArray()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.