21 private $configurableProductHandler;
26 private $configurableMock;
31 private $configurableProductsProviderMock;
41 $this->configurableMock = $this->createPartialMock(
45 $this->configurableProductsProviderMock = $this->createPartialMock(
46 \
Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider::class,
49 $this->ruleMock = $this->createMock(\
Magento\CatalogRule\Model\Rule::class);
52 $this->configurableMock,
53 $this->configurableProductsProviderMock
62 $this->configurableProductsProviderMock->expects($this->once())->method(
'getIds')->willReturn([]);
63 $this->configurableMock->expects($this->never())->method(
'getChildrenIds');
68 $this->configurableProductHandler->afterGetMatchingProductIds($this->ruleMock,
$productIds)
77 $this->configurableProductsProviderMock->expects($this->once())->method(
'getIds')
78 ->willReturn([
'conf1',
'conf2']);
79 $this->configurableMock->expects($this->any())->method(
'getChildrenIds')->willReturnMap([
80 [
'conf1',
true, [ 0 => [
'simple1']]],
81 [
'conf2',
true, [ 0 => [
'simple1',
'simple2']]],
95 $this->configurableProductHandler->afterGetMatchingProductIds(
testAfterGetMatchingProductIdsWithSimpleProduct()
testAfterGetMatchingProductIdsWithConfigurableProduct()