mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-23 13:06:02 +03:00
35 lines
846 B
PHP
35 lines
846 B
PHP
|
<?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());
|
||
|
}
|
||
|
}
|