Code Duplication    Length = 7-9 lines in 2 locations

tests/Aggregation/IpRangeTest.php 1 location

@@ 32-40 (lines=9) @@
29
        $query->addAggregation($agg);
30
        $results = $this->_getIndexForTest()->search($query)->getAggregation('ip');
31
32
        foreach ($results['buckets'] as $bucket) {
33
            if (\array_key_exists('key', $bucket) && $bucket['key'] == $cidrRange) {
34
                // the CIDR mask
35
                $this->assertEquals(3, $bucket['doc_count']);
36
            } else {
37
                // the normal ip ranges
38
                $this->assertEquals(2, $bucket['doc_count']);
39
            }
40
        }
41
    }
42
43
    /**

tests/Aggregation/DateRangeTest.php 1 location

@@ 50-56 (lines=7) @@
47
        $query->addAggregation($agg);
48
        $results = $this->_getIndexForTest()->search($query)->getAggregation('date');
49
50
        foreach ($results['buckets'] as $bucket) {
51
            if (\array_key_exists('to', $bucket)) {
52
                $this->assertEquals(1, $bucket['doc_count']);
53
            } elseif (\array_key_exists('from', $bucket)) {
54
                $this->assertEquals(2, $bucket['doc_count']);
55
            }
56
        }
57
    }
58
59
    /**