作者:ViniciusAugust
项目:magento
public function setUp()
{
$this->customerFactory = $this->getMockBuilder('Magento\\Customer\\Model\\CustomerFactory')->setMethods(['create'])->disableOriginalConstructor()->getMock();
$objectManager = new ObjectManager($this);
$this->customerRegistry = $objectManager->getObject('Magento\\Customer\\Model\\CustomerRegistry', ['customerFactory' => $this->customerFactory]);
$this->customer = $this->getMockBuilder('Magento\\Customer\\Model\\Customer')->disableOriginalConstructor()->setMethods(['load', 'getId', 'getEmail', 'getWebsiteId', '__wakeup', 'setEmail', 'setWebsiteId', 'loadByEmail'])->getMock();
}
作者:buskamuz
项目:magento2-skeleto
protected function setUp()
{
$helper = new ObjectManager($this);
$this->documentFactory = $this->getMockBuilder('Magento\\Framework\\Search\\Adapter\\Mysql\\DocumentFactory')->setMethods(['create'])->disableOriginalConstructor()->getMock();
$this->objectManager = $this->getMockBuilder('\\Magento\\Framework\\ObjectManager')->setMethods(['create'])->disableOriginalConstructor()->getMockForAbstractClass();
$this->factory = $helper->getObject('Magento\\Framework\\Search\\Adapter\\Mysql\\ResponseFactory', ['documentFactory' => $this->documentFactory, 'objectManager' => $this->objectManager]);
}