26 $this->registry = $this->getMockBuilder(\
Magento\Framework\Registry::class)
27 ->disableOriginalConstructor()
29 $this->formFactory = $this->getMockBuilder(
30 \
Magento\Framework\Data\FormFactory::class
31 )->disableOriginalConstructor()->getMock();
32 $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
33 $this->
object = $this->objectManagerHelper->getObject(
34 \
Magento\Bundle\Block\Adminhtml\Catalog\
Product\Edit\Tab\Attributes\Extend::class,
35 [
'registry' => $this->registry,
'formFactory' => $this->formFactory]
44 $product = $this->getMockBuilder(Product::class)->disableOriginalConstructor()->getMock();
45 $this->registry->expects($this->once())
57 $form = $this->getMockBuilder(\
Magento\Framework\Data\Form::class)->disableOriginalConstructor()->getMock();
58 $hasKey = new \PHPUnit\Framework\Constraint\ArrayHasKey(
'value');
59 $form->expects($this->once())->method(
'addField')->with(
65 $this->formFactory->expects($this->once())->method(
'create')->with()->will($this->returnValue($form));
68 $this->returnValue(123)
70 $this->
object->setIsDisabledField(
true);