objectManager = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); $objectManager = new ObjectManager($this); $this->object = $objectManager->getObject( \Magento\Framework\Url\RouteParamsResolverFactory::class, ['objectManager' => $this->objectManager] ); } public function testCreate() { $producedInstance = $this->createMock(\Magento\Framework\Url\RouteParamsResolverInterface::class); $this->objectManager->expects($this->once()) ->method('create') ->with(\Magento\Framework\Url\RouteParamsResolverInterface::class) ->will($this->returnValue($producedInstance)); $this->assertSame($producedInstance, $this->object->create([])); } }