Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
DummySearchIndexFieldDefinition
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getMapping
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3/**
4 * Dummy implementation of SearchIndexFieldDefinition for testing purposes.
5 *
6 * @since 1.28
7 */
8class DummySearchIndexFieldDefinition extends SearchIndexFieldDefinition {
9
10    /**
11     * @param SearchEngine $engine
12     *
13     * @return array
14     */
15    public function getMapping( SearchEngine $engine ) {
16        $mapping = [
17            'name' => $this->name,
18            'type' => $this->type,
19            'flags' => $this->flags,
20            'subfields' => []
21        ];
22
23        foreach ( $this->subfields as $subfield ) {
24            $mapping['subfields'][] = $subfield->getMapping( $engine );
25        }
26
27        return $mapping;
28    }
29
30}