From 9542c237173c3d8a3c7468d8826bbf585543e01f Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 9 May 2018 09:15:07 -0500 Subject: [PATCH] Fix tests formatting of DateTime/Carbon objects --- tests/TestCase.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 397c713b..689922b4 100755 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -126,6 +126,12 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase if (is_subclass_of($value, App\Interfaces\Unit::class)) { $data[$key] = $value->__toString(); } + + if($value instanceof DateTime) { + $data[$key] = $value->format(DATE_ATOM); + } elseif ($value instanceof Carbon) { + $data[$key] = $value->toIso8601ZuluString(); + } } return $data;