From ce0875f14781e4bfaf0ab6894aa8a869458ac20a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simonas=20=C5=A0erlinskas?= <simonas.serlinskas@nfq.com>
Date: Thu, 15 Mar 2018 15:04:26 +0100
Subject: [PATCH] addapt ranges count check to php 5.6 as well

---
 .../Aggregation/Bucketing/DateRangeAggregationTest.php    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/Unit/Aggregation/Bucketing/DateRangeAggregationTest.php b/tests/Unit/Aggregation/Bucketing/DateRangeAggregationTest.php
index c3858d0..13b0c8f 100644
--- a/tests/Unit/Aggregation/Bucketing/DateRangeAggregationTest.php
+++ b/tests/Unit/Aggregation/Bucketing/DateRangeAggregationTest.php
@@ -121,7 +121,13 @@ class DateRangeAggregationTest extends \PHPUnit_Framework_TestCase
             ->getMock();
         $aggregation->expects($this->once())->method('setField')->with($field);
         $aggregation->expects($this->once())->method('setFormat')->with($format);
-        $aggregation->expects($this->exactly(count($ranges ?? [])))->method('addRange');
+
+        if ($ranges) {
+            $rangesCount = count($ranges);
+        } else {
+            $rangesCount = 0;
+        }
+        $aggregation->expects($this->exactly($rangesCount))->method('addRange');
 
         if ($field !== null) {
             if ($format !== null) {
-- 
GitLab