Skip to content

Commit c4d5f96

Browse files
committed
ACP2E-4294: Restricted Category Products Still Counted in Wishlist After Customer Group Update
1 parent 5420597 commit c4d5f96

File tree

3 files changed

+10
-34
lines changed

3 files changed

+10
-34
lines changed

app/code/Magento/Wishlist/Test/Unit/Block/Customer/Wishlist/Item/OptionsTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\Framework\App\Http\Context;
1414
use Magento\Framework\Escaper;
1515
use Magento\Framework\Event\ManagerInterface;
16-
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1716
use Magento\Wishlist\Block\Customer\Wishlist\Item\Options;
1817
use Magento\Wishlist\Model\Item;
1918
use PHPUnit\Framework\MockObject\MockObject;
@@ -77,15 +76,7 @@ protected function setUp(): void
7776
->disableOriginalConstructor()
7877
->getMock();
7978

80-
$objectManager = new ObjectManager($this);
81-
$this->block = $objectManager->getObject(
82-
Options::class,
83-
[
84-
'context' => $productContextMock,
85-
'httpContext' => $this->httpContextMock,
86-
'helperPool' => $this->helperPoolMock,
87-
]
88-
);
79+
$this->block = new Options($productContextMock, $this->httpContextMock, $this->helperPoolMock);
8980
$this->block->setItem($this->itemMock);
9081
$this->block->addOptionsRenderCfg(self::TEST_PRODUCT_TYPE, self::TEST_HELPER_CLASS_NAME);
9182
}

app/code/Magento/Wishlist/Test/Unit/Model/WishlistTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use Magento\Wishlist\Model\ResourceModel\Wishlist as WishlistResource;
3636
use Magento\Wishlist\Model\ResourceModel\Wishlist\Collection as WishlistCollection;
3737
use Magento\Wishlist\Model\Wishlist;
38+
use Magento\Wishlist\Model\WishlistItemPermissionsCollectionProcessor;
3839
use PHPUnit\Framework\MockObject\MockObject;
3940
use PHPUnit\Framework\TestCase;
4041

@@ -138,6 +139,11 @@ class WishlistTest extends TestCase
138139
*/
139140
private $stockConfiguration;
140141

142+
/**
143+
* @var WishlistItemPermissionsCollectionProcessor|MockObject
144+
*/
145+
private WishlistItemPermissionsCollectionProcessor $permissionCollectionProcessor;
146+
141147
protected function setUp(): void
142148
{
143149
$context = $this->getMockBuilder(Context::class)
@@ -200,6 +206,7 @@ protected function setUp(): void
200206
->willReturn($this->eventDispatcher);
201207

202208
$this->stockConfiguration = $this->createMock(StockConfigurationInterface::class);
209+
$this->permissionCollectionProcessor = $this->createMock(WishlistItemPermissionsCollectionProcessor::class);
203210

204211
$this->wishlist = new Wishlist(
205212
$context,
@@ -221,7 +228,8 @@ protected function setUp(): void
221228
$this->serializer,
222229
$this->stockRegistry,
223230
$this->scopeConfig,
224-
$this->stockConfiguration
231+
$this->stockConfiguration,
232+
$this->permissionCollectionProcessor
225233
);
226234
}
227235

app/code/Magento/WishlistGraphQl/etc/graphql/events.xml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)