File tree Expand file tree Collapse file tree
src/module-elasticsuite-core/Test/Unit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments