25 private $hashMapPoolMock;
28 private $dataCategoryMapMock;
31 private $dataCategoryUsedInProductsMapMock;
34 private $temporaryTableServiceMock;
37 private $connectionMock;
44 $this->hashMapPoolMock = $this->createMock(HashMapPool::class);
45 $this->dataCategoryMapMock = $this->createMock(DataProductHashMap::class);
46 $this->dataCategoryUsedInProductsMapMock = $this->createMock(DataCategoryUsedInProductsHashMap::class);
47 $this->temporaryTableServiceMock = $this->createMock(TemporaryTableService::class);
48 $this->connectionMock = $this->createMock(ResourceConnection::class);
50 $this->hashMapPoolMock->expects($this->any())
51 ->method(
'getDataMap')
52 ->willReturnOnConsecutiveCalls($this->dataCategoryUsedInProductsMapMock, $this->dataCategoryMapMock);
55 DataCategoryUrlRewriteDatabaseMap::class,
57 'connection' => $this->connectionMock,
58 'hashMapPool' => $this->hashMapPoolMock,
59 'temporaryTableService' => $this->temporaryTableServiceMock
70 '1' => [
'store_id' => 1,
'category_id' => 1],
71 '2' => [
'store_id' => 2,
'category_id' => 1],
72 '3' => [
'store_id' => 3,
'category_id' => 1],
73 '4' => [
'store_id' => 1,
'category_id' => 2],
74 '5' => [
'store_id' => 2,
'category_id' => 2],
77 $connectionMock = $this->createMock(AdapterInterface::class);
78 $selectMock = $this->createMock(Select::class);
80 $this->connectionMock->expects($this->any())
81 ->method(
'getConnection')
82 ->willReturn($connectionMock);
83 $connectionMock->expects($this->any())
85 ->willReturn($selectMock);
86 $connectionMock->expects($this->any())
88 ->willReturn($productStoreIds[3]);
89 $selectMock->expects($this->any())
92 $selectMock->expects($this->any())
95 $selectMock->expects($this->any())
98 $this->dataCategoryMapMock->expects($this->once())
99 ->method(
'getAllData')
101 $this->dataCategoryUsedInProductsMapMock->expects($this->once())
102 ->method(
'getAllData')
104 $this->temporaryTableServiceMock->expects($this->any())
105 ->method(
'createFromSelect')
110 'PRIMARY' => [
'url_rewrite_id'],
111 'HASHKEY_ENTITY_STORE' => [
'hash_key'],
112 'ENTITY_STORE' => [
'entity_id',
'store_id']
115 ->willReturn(
'tempTableName');
117 $this->assertEquals($productStoreIds[3], $this->model->getData(1,
'3_1'));