6
6
namespace Magento \CatalogSearch \Model \Indexer ;
7
7
8
8
use Magento \Catalog \Model \Product ;
9
+ use Magento \CatalogSearch \Model \Indexer \Fulltext ;
10
+ use Magento \CatalogSearch \Model \Indexer \IndexSwitcherMock ;
9
11
use Magento \CatalogSearch \Model \ResourceModel \Fulltext \Collection ;
10
12
use Magento \TestFramework \Helper \Bootstrap ;
11
13
@@ -46,27 +48,27 @@ class SwitcherUsedInFulltextTest extends \PHPUnit_Framework_TestCase
46
48
protected $ queryFactory ;
47
49
48
50
/**
49
- * @var Product
51
+ * @var \Magento\Catalog\Model\ Product
50
52
*/
51
53
protected $ productApple ;
52
54
53
55
/**
54
- * @var Product
56
+ * @var \Magento\Catalog\Model\ Product
55
57
*/
56
58
protected $ productBanana ;
57
59
58
60
/**
59
- * @var Product
61
+ * @var \Magento\Catalog\Model\ Product
60
62
*/
61
63
protected $ productOrange ;
62
64
63
65
/**
64
- * @var Product
66
+ * @var \Magento\Catalog\Model\ Product
65
67
*/
66
68
protected $ productPapaya ;
67
69
68
70
/**
69
- * @var Product
71
+ * @var \Magento\Catalog\Model\ Product
70
72
*/
71
73
protected $ productCherry ;
72
74
@@ -81,10 +83,10 @@ protected function setUp()
81
83
82
84
$ objectManager ->configure (
83
85
[
84
- ltrim (\ Magento \ CatalogSearch \ Model \ Indexer \ Fulltext::class, '\\' ) => [
86
+ ltrim (Fulltext::class, '\\' ) => [
85
87
'arguments ' => [
86
88
'indexSwitcher ' => [
87
- 'instance ' => ltrim (\ Magento \ CatalogSearch \ Model \ Indexer \ IndexSwitcherMock::class, '\\' ),
89
+ 'instance ' => ltrim (IndexSwitcherMock::class, '\\' ),
88
90
],
89
91
],
90
92
],
@@ -115,7 +117,7 @@ protected function setUp()
115
117
);
116
118
117
119
$ this ->indexSwitcher = Bootstrap::getObjectManager ()->get (
118
- \ Magento \ CatalogSearch \ Model \ Indexer \ IndexSwitcherMock::class
120
+ IndexSwitcherMock::class
119
121
);
120
122
121
123
$ this ->productApple = $ this ->getProductBySku ('fulltext-1 ' );
@@ -132,9 +134,9 @@ public function testReindexAll()
132
134
{
133
135
$ this ->indexer ->reindexAll ();
134
136
135
- /** @var \Magento\CatalogSearch\Model\Indexer\ IndexSwitcherMock $indexSwitcher */
137
+ /** @var IndexSwitcherMock $indexSwitcher */
136
138
$ indexSwitcher = Bootstrap::getObjectManager ()->get (
137
- \ Magento \ CatalogSearch \ Model \ Indexer \ IndexSwitcherMock::class
139
+ IndexSwitcherMock::class
138
140
);
139
141
$ this ->assertTrue ($ indexSwitcher ->isSwitched ());
140
142
}
@@ -146,9 +148,9 @@ public function testReindexList()
146
148
{
147
149
$ this ->indexer ->reindexList ([$ this ->productApple ->getId (), $ this ->productBanana ->getId ()]);
148
150
149
- /** @var \Magento\CatalogSearch\Model\Indexer\ IndexSwitcherMock $indexSwitcher */
151
+ /** @var IndexSwitcherMock $indexSwitcher */
150
152
$ indexSwitcher = Bootstrap::getObjectManager ()->get (
151
- \ Magento \ CatalogSearch \ Model \ Indexer \ IndexSwitcherMock::class
153
+ IndexSwitcherMock::class
152
154
);
153
155
$ this ->assertFalse ($ indexSwitcher ->isSwitched ());
154
156
}
@@ -160,9 +162,9 @@ public function testReindexRow()
160
162
{
161
163
$ this ->indexer ->reindexRow ($ this ->productPapaya ->getId ());
162
164
163
- /** @var \Magento\CatalogSearch\Model\Indexer\ IndexSwitcherMock $indexSwitcher */
165
+ /** @var IndexSwitcherMock $indexSwitcher */
164
166
$ indexSwitcher = Bootstrap::getObjectManager ()->get (
165
- \ Magento \ CatalogSearch \ Model \ Indexer \ IndexSwitcherMock::class
167
+ IndexSwitcherMock::class
166
168
);
167
169
$ this ->assertFalse ($ indexSwitcher ->isSwitched ());
168
170
}
0 commit comments