Test Parse model for Parseable and Unparseable data

This commit is contained in:
David Garcia 2018-02-01 23:51:47 +00:00 committed by David Garcia
parent 6fc5b1e938
commit df7043343e

View File

@ -0,0 +1,34 @@
<?php
namespace Mailgun\Tests\Model\EmailValidation;
use Mailgun\Model\EmailValidation\Parse;
class ParseTest extends \PHPUnit_Framework_TestCase
{
public function testParseConstructorWithValidData()
{
$data = [
'parsed' => ['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());
}
}