From 30bc68e6e2d642ec1a8258de377d46782825f616 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 15 Jul 2020 16:48:22 +0400 Subject: Added integer parser Signed-off-by: Valentin Popov --- tests/Parsers/IntegerParserTest.php | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/Parsers/IntegerParserTest.php (limited to 'tests') diff --git a/tests/Parsers/IntegerParserTest.php b/tests/Parsers/IntegerParserTest.php new file mode 100644 index 0000000..7f5cce7 --- /dev/null +++ b/tests/Parsers/IntegerParserTest.php @@ -0,0 +1,40 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 + * @package Tests\Parsers + */ +final class IntegerParserTest extends TestCase { + public function testInvalid(): void { + self::assertNull(IntegerParser::get(null)); + } + + public function testValid(): void { + $number = Faker::create()->numberBetween(100, 200); + self::assertEquals($number, IntegerParser::get((string) $number)); + } +} -- cgit v1.2.3