5
5
*/
6
6
namespace Magento \CatalogUrlRewrite \Test \Unit \Model \Map ;
7
7
8
- use Magento \Catalog \Model \ResourceModel \Category \Collection ;
9
8
use Magento \Catalog \Model \ResourceModel \Category as CategoryResource ;
10
9
use Magento \Framework \DB \Select ;
11
10
use Magento \Catalog \Model \CategoryRepository ;
@@ -22,9 +21,6 @@ class DataCategoryHashMapTest extends \PHPUnit_Framework_TestCase
22
21
/** @var CategoryRepository|\PHPUnit_Framework_MockObject_MockObject */
23
22
private $ categoryRepository ;
24
23
25
- /** @var Collection|\PHPUnit_Framework_MockObject_MockObject */
26
- private $ collection ;
27
-
28
24
/** @var CategoryResource|\PHPUnit_Framework_MockObject_MockObject */
29
25
private $ categoryResource ;
30
26
@@ -34,7 +30,6 @@ class DataCategoryHashMapTest extends \PHPUnit_Framework_TestCase
34
30
protected function setUp ()
35
31
{
36
32
$ this ->categoryRepository = $ this ->getMock (CategoryRepository::class, [], [], '' , false );
37
- $ this ->collection = $ this ->getMock (Collection::class, ['addIdFilter ' , 'getAllIds ' ], [], '' , false );
38
33
$ this ->categoryResource = $ this ->getMock (
39
34
CategoryResource::class,
40
35
['getConnection ' , 'getEntityTable ' ],
@@ -47,7 +42,6 @@ protected function setUp()
47
42
DataCategoryHashMap::class,
48
43
[
49
44
'categoryRepository ' => $ this ->categoryRepository ,
50
- 'collection ' => $ this ->collection ,
51
45
'categoryResource ' => $ this ->categoryResource
52
46
]
53
47
);
@@ -68,15 +62,6 @@ public function testGetAllData()
68
62
$ this ->categoryRepository ->expects ($ this ->any ())
69
63
->method ('get ' )
70
64
->willReturn ($ categoryMock );
71
- $ categoryMock ->expects ($ this ->any ())
72
- ->method ('getResourceCollection ' )
73
- ->willReturn ($ this ->collection );
74
- $ this ->collection ->expects ($ this ->any ())
75
- ->method ('addIdFilter ' )
76
- ->willReturnSelf ();
77
- $ this ->collection ->expects ($ this ->exactly (3 ))
78
- ->method ('getAllIds ' )
79
- ->willReturnOnConsecutiveCalls ($ categoryIds , $ categoryIdsOther , $ categoryIds );
80
65
$ categoryMock ->expects ($ this ->any ())
81
66
->method ('getResource ' )
82
67
->willReturn ($ this ->categoryResource );
@@ -97,7 +82,7 @@ public function testGetAllData()
97
82
->willReturnSelf ();
98
83
$ connectionAdapterMock ->expects ($ this ->any ())
99
84
->method ('fetchCol ' )
100
- ->willReturnOnConsecutiveCalls ($ categoryIds , $ categoryIdsOther );
85
+ ->willReturnOnConsecutiveCalls ($ categoryIds , $ categoryIdsOther, $ categoryIds );
101
86
102
87
$ this ->assertEquals ($ categoryIds , $ this ->model ->getAllData (1 ));
103
88
$ this ->assertEquals ($ categoryIds [2 ], $ this ->model ->getData (1 , 2 ));
0 commit comments