mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 06:16:03 +03:00
Test Parse model for Parseable and Unparseable data
This commit is contained in:
parent
6fc5b1e938
commit
df7043343e
34
tests/Model/EmailValidation/ParseTest.php
Normal file
34
tests/Model/EmailValidation/ParseTest.php
Normal 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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user