7 declare(strict_types=1);
24 private $productTypeChildrenValidationMap;
29 private $objectManager;
39 private $quoteItemMock;
50 $this->productTypeChildrenValidationMap = [
55 $this->quoteItemMock = $this->getMockBuilder(QuoteItem::class)
56 ->disableOriginalConstructor()
57 ->setMethods([
'getProduct'])
58 ->getMockForAbstractClass();
60 $this->productMock = $this->getMockBuilder(Product::class)
61 ->disableOriginalConstructor()
62 ->setMethods([
'getTypeId'])
65 $this->model = $this->objectManager->getObject(
66 ChildrenValidationLocator::class,
68 'productTypeChildrenValidationMap' => $this->productTypeChildrenValidationMap,
82 $this->quoteItemMock->expects($this->once())
83 ->method(
'getProduct')
84 ->willReturn($this->productMock);
86 $this->productMock->expects($this->once())
90 $this->assertEquals($this->model->isChildrenValidationRequired($this->quoteItemMock), $expected);
productTypeDataProvider()
testIsChildrenValidationRequired(string $type, bool $expected)