Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | public function testJoinField(): void |
||
36 | { |
||
37 | $join = new JoinProcessor('name', '-'); |
||
38 | |||
39 | $pipeline = $this->_createPipeline('my_custom_pipeline', 'pipeline for Join'); |
||
40 | $pipeline->addProcessor($join)->create(); |
||
41 | |||
42 | $index = $this->_createIndex(); |
||
43 | $bulk = new Bulk($index->getClient()); |
||
44 | $bulk->setIndex($index); |
||
45 | |||
46 | $bulk->addDocument(new Document(null, ['name' => ['abc', 'def', 'ghij']])); |
||
47 | $bulk->setRequestParam('pipeline', 'my_custom_pipeline'); |
||
48 | |||
49 | $bulk->send(); |
||
50 | $index->refresh(); |
||
51 | |||
52 | $result = $index->search('*'); |
||
53 | |||
54 | $this->assertCount(1, $result->getResults()); |
||
|
|||
55 | |||
56 | $results = $result->getResults(); |
||
57 | $this->assertSame('abc-def-ghij', ($results[0]->getHit())['_source']['name']); |
||
58 | } |
||
59 | } |
||
60 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: