From b59a60f17e14921d6bca7f5113277c0dda9ea26c Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Wed, 7 Feb 2018 10:21:20 +0800 Subject: [PATCH] isAddress test --- src/Utils.php | 6 +++--- test/unit/UtilsTest.php | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Utils.php b/src/Utils.php index df92fb4..e9da234 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -152,7 +152,7 @@ class Utils /** * isAddress * - * @param string + * @param string $value * @return bool */ public static function isAddress($value) @@ -171,7 +171,7 @@ class Utils /** * isAddressChecksum * - * @param string + * @param string $value * @return bool */ public static function isAddressChecksum($value) @@ -196,7 +196,7 @@ class Utils /** * isHex * - * @param string + * @param string $value * @return bool */ public static function isHex($value) diff --git a/test/unit/UtilsTest.php b/test/unit/UtilsTest.php index 500730c..46b3ffe 100644 --- a/test/unit/UtilsTest.php +++ b/test/unit/UtilsTest.php @@ -150,6 +150,9 @@ class UtilsTest extends TestCase $isAddress = Utils::isAddress('0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C'); $this->assertEquals($isAddress, true); + $isAddress = Utils::isAddress('0xCA35B7D915458EF540ADE6068DFE2F44E8FA73cc'); + $this->assertEquals($isAddress, false); + $this->expectException(InvalidArgumentException::class); $isAddress = Utils::isAddress(new stdClass); }