From df7043343e873dbd92ae8d9e6b27548ee5a1b8ab Mon Sep 17 00:00:00 2001 From: David Garcia Date: Thu, 1 Feb 2018 23:51:47 +0000 Subject: [PATCH] Test Parse model for Parseable and Unparseable data --- tests/Model/EmailValidation/ParseTest.php | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/Model/EmailValidation/ParseTest.php diff --git a/tests/Model/EmailValidation/ParseTest.php b/tests/Model/EmailValidation/ParseTest.php new file mode 100644 index 0000000..2c746ef --- /dev/null +++ b/tests/Model/EmailValidation/ParseTest.php @@ -0,0 +1,34 @@ + ['parsed data'], + 'unparseable' => ['unparseable data'], + ]; + + $parts = Parse::create($data); + + $this->assertEquals($data['parsed'], $parts->getParsed()); + $this->assertEquals($data['unparseable'], $parts->getUnparseable()); + } + + public function testParseConstructorWithInvalidData() + { + $data = [ + 'parsed' => null, + 'unparseable' => null, + ]; + + $parts = Parse::create($data); + + $this->assertEquals([], $parts->getParsed()); + $this->assertEquals([], $parts->getUnparseable()); + } +}