23 private $hashMapPoolMock;
26 private $dataProductMapMock;
29 private $temporaryTableServiceMock;
32 private $connectionMock;
39 $this->hashMapPoolMock = $this->createMock(HashMapPool::class);
40 $this->dataProductMapMock = $this->createMock(DataProductHashMap::class);
41 $this->temporaryTableServiceMock = $this->createMock(TemporaryTableService::class);
42 $this->connectionMock = $this->createMock(ResourceConnection::class);
44 $this->hashMapPoolMock->expects($this->any())
45 ->method(
'getDataMap')
46 ->willReturn($this->dataProductMapMock);
49 DataProductUrlRewriteDatabaseMap::class,
51 'connection' => $this->connectionMock,
52 'hashMapPool' => $this->hashMapPoolMock,
53 'temporaryTableService' => $this->temporaryTableServiceMock
64 '1' => [
'store_id' => 1,
'product_id' => 1],
65 '2' => [
'store_id' => 2,
'product_id' => 1],
66 '3' => [
'store_id' => 3,
'product_id' => 1],
67 '4' => [
'store_id' => 1,
'product_id' => 2],
68 '5' => [
'store_id' => 2,
'product_id' => 2],
71 $connectionMock = $this->createMock(AdapterInterface::class);
72 $selectMock = $this->createMock(Select::class);
74 $this->connectionMock->expects($this->any())
75 ->method(
'getConnection')
76 ->willReturn($connectionMock);
77 $connectionMock->expects($this->any())
79 ->willReturn($selectMock);
80 $connectionMock->expects($this->any())
82 ->willReturn($productStoreIds[3]);
83 $selectMock->expects($this->any())
86 $selectMock->expects($this->any())
89 $selectMock->expects($this->any())
93 $this->dataProductMapMock->expects($this->any())
94 ->method(
'getAllData')
97 $this->temporaryTableServiceMock->expects($this->any())
98 ->method(
'createFromSelect')
103 'PRIMARY' => [
'url_rewrite_id'],
104 'HASHKEY_ENTITY_STORE' => [
'hash_key'],
105 'ENTITY_STORE' => [
'entity_id',
'store_id']
108 ->willReturn(
'tempTableName');
110 $this->assertEquals($productStoreIds[3], $this->model->getData(1,
'3_1'));