22 $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
24 $this->objectManagerMock = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
26 $this->blockFactory = $objectManagerHelper->getObject(
28 [
'objectManager' => $this->objectManagerMock]
34 $className = \Magento\Framework\View\Element\Template::class;
35 $argumentsResult = [
'arg1',
'arg2'];
38 ->disableOriginalConstructor()->getMock();
40 $this->objectManagerMock->expects($this->once())
43 ->will($this->returnValue($templateMock));
45 $this->assertInstanceOf(
47 $this->blockFactory->createBlock(
$className, $argumentsResult)
56 $this->blockFactory->createBlock(
'invalid_class_name');
testCreateBlockWithException()