File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer
lib/internal/Magento/Framework/App Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ class FulltextTest extends \PHPUnit\Framework\TestCase
54
54
*/
55
55
private $ indexSwitcher ;
56
56
57
+ /**
58
+ * @var \Magento\Indexer\Model\ProcessManager
59
+ */
60
+ private $ processManager ;
61
+
57
62
protected function setUp ()
58
63
{
59
64
$ this ->fullAction = $ this ->getClassMock (\Magento \CatalogSearch \Model \Indexer \Fulltext \Action \Full::class);
@@ -89,6 +94,8 @@ protected function setUp()
89
94
->setMethods (['switchIndex ' ])
90
95
->getMock ();
91
96
97
+ $ this ->processManager = new \Magento \Indexer \Model \ProcessManager ();
98
+
92
99
$ objectManagerHelper = new ObjectManagerHelper ($ this );
93
100
$ this ->model = $ objectManagerHelper ->getObject (
94
101
\Magento \CatalogSearch \Model \Indexer \Fulltext::class,
@@ -101,6 +108,7 @@ protected function setUp()
101
108
'searchRequestConfig ' => $ this ->searchRequestConfig ,
102
109
'data ' => [],
103
110
'indexSwitcher ' => $ this ->indexSwitcher ,
111
+ 'processManager ' => $ this ->processManager ,
104
112
]
105
113
);
106
114
}
Original file line number Diff line number Diff line change @@ -105,15 +105,15 @@ public function closeConnection($resourceName = self::DEFAULT_CONNECTION)
105
105
{
106
106
if ($ resourceName === null ) {
107
107
foreach ($ this ->connections as $ processConnection ) {
108
- if ($ processConnection instanceof AdapterInterface ) {
108
+ if ($ processConnection !== null ) {
109
109
$ processConnection ->closeConnection ();
110
110
}
111
111
}
112
112
$ this ->connections = [];
113
113
} else {
114
114
$ processConnectionName = $ this ->getProcessConnectionName ($ this ->config ->getConnectionName ($ resourceName ));
115
115
if (isset ($ this ->connections [$ processConnectionName ])) {
116
- if ($ this ->connections [$ processConnectionName ] instanceof AdapterInterface ) {
116
+ if ($ this ->connections [$ processConnectionName ] !== null ) {
117
117
$ this ->connections [$ processConnectionName ]->closeConnection ();
118
118
}
119
119
$ this ->connections [$ processConnectionName ] = null ;
You can’t perform that action at this time.
0 commit comments