48 $this->registryMock = $this->getMockBuilder(Registry::class)
49 ->setMethods([
'registry'])
51 $this->productMock = $this->getMockBuilder(ProductInterface::class)
52 ->getMockForAbstractClass();
53 $this->storeMock = $this->getMockBuilder(StoreInterface::class)
54 ->getMockForAbstractClass();
56 $this->model = $this->objectManager->getObject(RegistryLocator::class, [
57 'registry' => $this->registryMock,
63 $this->registryMock->expects($this->once())
65 ->with(
'current_product')
66 ->willReturn($this->productMock);
68 $this->assertInstanceOf(ProductInterface::class, $this->model->getProduct());
70 $this->assertInstanceOf(ProductInterface::class, $this->model->getProduct());
75 $this->registryMock->expects($this->once())
77 ->with(
'current_store')
78 ->willReturn($this->storeMock);
80 $this->assertInstanceOf(StoreInterface::class, $this->model->getStore());
82 $this->assertInstanceOf(StoreInterface::class, $this->model->getStore());
91 $this->assertInstanceOf(ProductInterface::class, $this->model->getProduct());
100 $this->assertInstanceOf(StoreInterface::class, $this->model->getStore());
testGetStoreWithException()
testGetProductWithException()