Skip to content

Commit 0de03aa

Browse files
committed
#24781: Added integration test.
1 parent e18a6fb commit 0de03aa

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Elasticsearch6\SearchAdapter;
9+
10+
use Magento\Elasticsearch\Elasticsearch5\SearchAdapter\ConnectionManager;
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
13+
/**
14+
* Test for \Magento\Elasticsearch\SearchAdapter\ConnectionManager class.
15+
*/
16+
class ConnectionManagerTest extends \PHPUnit\Framework\TestCase
17+
{
18+
/**
19+
* @var \Magento\Framework\ObjectManagerInterface
20+
*/
21+
private $objectManager;
22+
23+
/**
24+
* @var \Magento\Elasticsearch\SearchAdapter\ConnectionManager
25+
*/
26+
private $connectionManager;
27+
28+
protected function setUp()
29+
{
30+
$this->objectManager = Bootstrap::getObjectManager();
31+
32+
$this->connectionManager = $this->objectManager->create(ConnectionManager::class);
33+
}
34+
35+
/**
36+
* Test if 'elasticsearch6' search engine returned by connection manager.
37+
*
38+
* @magentoAppIsolation enabled
39+
* @magentoConfigFixture default/catalog/search/engine elasticsearch6
40+
*/
41+
public function testCorrectElasticsearchClient()
42+
{
43+
$connection = $this->connectionManager->getConnection();
44+
$this->assertInstanceOf(
45+
\Magento\Elasticsearch6\Model\Client\Elasticsearch::class,
46+
$connection
47+
);
48+
}
49+
}

0 commit comments

Comments
 (0)