From d5bda98a9cbed9239013d42177def7bab0ce45fc Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Fri, 15 May 2020 11:09:25 -0400 Subject: [PATCH] Works for normal arrays too --- tests/Stripe/Service/AbstractServiceTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Stripe/Service/AbstractServiceTest.php b/tests/Stripe/Service/AbstractServiceTest.php index 0eac886d7..d4e9bd6f5 100644 --- a/tests/Stripe/Service/AbstractServiceTest.php +++ b/tests/Stripe/Service/AbstractServiceTest.php @@ -68,5 +68,11 @@ public function testFormatParams() static::assertTrue('' === $result['foo']['bar']); static::assertTrue(null !== $result['foo']['bar']); static::assertTrue(1 === $result['foo']['baz']); + + $result = \Stripe\Service\AbstractService::formatParams(['foo' => ["bar", null, null, "baz"]]); + static::assertTrue('bar' === $result['foo'][0]); + static::assertTrue('' === $result['foo'][1]); + static::assertTrue('' === $result['foo'][2]); + static::assertTrue('baz' === $result['foo'][3]); } }