Code Duplication    Length = 14-14 lines in 3 locations

tests/Aggregation/BucketScriptTest.php 1 location

@@ 105-118 (lines=14) @@
102
        $serialDiffAgg->toArray();
103
    }
104
105
    protected function _getIndexForTest(): Index
106
    {
107
        $index = $this->_createIndex();
108
109
        $index->addDocuments([
110
            Document::create(['weight' => 60, 'height' => 180, 'age' => 25]),
111
            Document::create(['weight' => 65, 'height' => 156, 'age' => 32]),
112
            Document::create(['weight' => 50, 'height' => 155, 'age' => 45]),
113
        ]);
114
115
        $index->refresh();
116
117
        return $index;
118
    }
119
}
120

tests/Aggregation/StatsBucketTest.php 1 location

@@ 77-90 (lines=14) @@
74
        $serialDiffAgg->toArray();
75
    }
76
77
    protected function _getIndexForTest(): Index
78
    {
79
        $index = $this->_createIndex();
80
81
        $index->addDocuments([
82
            Document::create(['weight' => 60, 'height' => 180, 'age' => 25]),
83
            Document::create(['weight' => 70, 'height' => 156, 'age' => 32]),
84
            Document::create(['weight' => 50, 'height' => 155, 'age' => 45]),
85
        ]);
86
87
        $index->refresh();
88
89
        return $index;
90
    }
91
}
92

tests/Aggregation/ExtendedStatsBucketTest.php 1 location

@@ 70-83 (lines=14) @@
67
        $this->assertEquals($expected, $serialDiffAgg->toArray());
68
    }
69
70
    private function _getIndexForTest(): Index
71
    {
72
        $index = $this->_createIndex();
73
74
        $index->addDocuments([
75
            Document::create(['weight' => 60, 'height' => 180, 'age' => 25]),
76
            Document::create(['weight' => 70, 'height' => 156, 'age' => 32]),
77
            Document::create(['weight' => 50, 'height' => 155, 'age' => 45]),
78
        ]);
79
80
        $index->refresh();
81
82
        return $index;
83
    }
84
}
85