File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed
Catalog/Test/Unit/Model/Indexer/Product/Eav
CatalogSearch/Test/Unit/Plugin Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ class AbstractActionTest extends \PHPUnit\Framework\TestCase
27
27
*/
28
28
private $ scopeConfig ;
29
29
30
+ /**
31
+ * @return void
32
+ */
30
33
protected function setUp ()
31
34
{
32
35
$ this ->_eavDecimalFactoryMock = $ this ->createPartialMock (
@@ -50,6 +53,9 @@ protected function setUp()
50
53
);
51
54
}
52
55
56
+ /**
57
+ * @return void
58
+ */
53
59
public function testGetIndexers ()
54
60
{
55
61
$ expectedIndexers = [
@@ -85,6 +91,10 @@ public function testGetIndexerWithUnknownTypeThrowsException()
85
91
$ this ->_model ->getIndexer ('unknown_type ' );
86
92
}
87
93
94
+ /**
95
+ * @return void
96
+ * @throws \Magento\Framework\Exception\LocalizedException
97
+ */
88
98
public function testGetIndexer ()
89
99
{
90
100
$ this ->_eavSourceFactoryMock ->expects ($ this ->once ())
@@ -98,6 +108,10 @@ public function testGetIndexer()
98
108
$ this ->assertEquals ('source_return_value ' , $ this ->_model ->getIndexer ('source ' ));
99
109
}
100
110
111
+ /**
112
+ * @return void
113
+ * @throws \Exception
114
+ */
101
115
public function testReindexWithoutArgumentsExecutesReindexAll ()
102
116
{
103
117
$ eavSource = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Product \Indexer \Eav \Source::class)
@@ -197,6 +211,10 @@ public function testReindexWithNotNullArgumentExecutesReindexEntities(
197
211
$ this ->_model ->reindex ($ ids );
198
212
}
199
213
214
+ /**
215
+ * @return void
216
+ * @throws \Exception
217
+ */
200
218
public function testReindexWithDisabledEavIndexer ()
201
219
{
202
220
$ this ->scopeConfig ->expects ($ this ->once ())->method ('getValue ' )->willReturn (0 );
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ class FullTest extends \PHPUnit\Framework\TestCase
58
58
*/
59
59
private $ scopeConfig ;
60
60
61
+ /**
62
+ * @return void
63
+ */
61
64
protected function setUp ()
62
65
{
63
66
$ this ->eavDecimalFactory = $ this ->createPartialMock (DecimalFactory::class, ['create ' ]);
@@ -148,6 +151,10 @@ public function testExecute()
148
151
$ this ->model ->execute ();
149
152
}
150
153
154
+ /**
155
+ * @return void
156
+ * @throws \Magento\Framework\Exception\LocalizedException
157
+ */
151
158
public function testExecuteWithDisabledEavIndexer ()
152
159
{
153
160
$ this ->scopeConfig ->expects ($ this ->once ())->method ('getValue ' )->willReturn (0 );
Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ protected function setUp()
39
39
);
40
40
}
41
41
42
+ /**
43
+ * Test with other search engine (not MySQL) selected in config
44
+ *
45
+ * @return void
46
+ */
42
47
public function testBeforeSave ()
43
48
{
44
49
$ this ->config ->expects ($ this ->once ())->method ('getData ' )->willReturn ('elasticsearch ' );
@@ -47,6 +52,11 @@ public function testBeforeSave()
47
52
$ this ->model ->beforeSave ($ this ->config );
48
53
}
49
54
55
+ /**
56
+ * Test with MySQL search engine selected in config
57
+ *
58
+ * @return void
59
+ */
50
60
public function testBeforeSaveMysqlSearchEngine ()
51
61
{
52
62
$ this ->config ->expects ($ this ->at (0 ))->method ('getData ' )->willReturn ('mysql ' );
You can’t perform that action at this time.
0 commit comments