24 $this->objectManagerMock = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
26 $this->objectManagerHelper =
new ObjectManagerHelper($this);
27 $this->layoutFactory = $this->objectManagerHelper->getObject(
28 \
Magento\Framework\View\LayoutFactory::class,
30 'objectManager' => $this->objectManagerMock
37 $instance = \Magento\Framework\View\LayoutInterface::class;
38 $layoutMock = $this->createMock($instance);
39 $data = [
'some' =>
'data'];
40 $this->objectManagerMock->expects($this->once())
42 ->with($this->equalTo($instance), $this->equalTo(
$data))
43 ->will($this->returnValue($layoutMock));
44 $this->assertInstanceOf($instance, $this->layoutFactory->create(
$data));
53 $data = [
'some' =>
'other_data'];
54 $this->objectManagerMock->expects($this->once())
56 ->will($this->returnValue(
new \stdClass()));
57 $this->layoutFactory->create(
$data);