Skip to content

Commit 65a7c86

Browse files
authored
Merge pull request #3792 from rbayet/feat_extra_unit_tests
[Core] Adding extra unit tests
2 parents 0c6e0fc + 4db0e7d commit 65a7c86

2 files changed

Lines changed: 885 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* DISCLAIMER
4+
*
5+
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer versions in the future.
6+
*
7+
* @category Smile
8+
* @package Smile\ElasticsuiteCatalog
9+
* @author Richard BAYET <richard.bayet@smile.fr>
10+
* @copyright 2026 Smile
11+
* @license Open Software License ("OSL") v. 3.0
12+
*/
13+
14+
namespace Smile\ElasticsuiteCore\Test\Unit\Helper;
15+
16+
use PHPUnit\Framework\TestCase;
17+
18+
/**
19+
* Mapping helper test case.
20+
*
21+
* @category Smile
22+
* @package Smile\ElasticsuiteCore
23+
* @author Richard BAYET <richard.bayet@smile.fr>
24+
*/
25+
class MappingTest extends TestCase
26+
{
27+
/**
28+
* Tests that getOptionTextFieldName returns a string with the 'option_text_' prefix prepended to the field name.
29+
*
30+
* @return void
31+
*/
32+
public function testGetOptionTextFieldNameReturnsStringWithPrefixPrependedToFieldName()
33+
{
34+
$mockContext = $this->createMock(\Magento\Framework\App\Helper\Context::class);
35+
$mapping = new \Smile\ElasticsuiteCore\Helper\Mapping($mockContext);
36+
$fieldName = 'test_field';
37+
$result = $mapping->getOptionTextFieldName($fieldName);
38+
39+
$this->assertEquals('option_text_test_field', $result);
40+
}
41+
}

0 commit comments

Comments
 (0)