[SoapCommon] Added assert instance of Part in ParserTest.php

This commit is contained in:
Francis Besset 2013-07-19 11:50:37 +02:00
parent a2bd42c71f
commit 0a47f5c15f

View File

@ -45,11 +45,13 @@ class ParserTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('xxx-MIME-Boundary-xxx-0xa36cb38-0a36cb38-xxx-END-xxx', $mp->getHeader('Content-Type', 'boundary'));
$p1 = $mp->getPart();
$this->assertInstanceOf('BeSimple\SoapCommon\Mime\Part', $p1);
$this->assertEquals('text/xml', $p1->getHeader('Content-Type'));
$this->assertEquals('UTF-8', $p1->getHeader('Content-Type', 'charset'));
$this->assertEquals(389, strlen($p1->getContent()));
$p2 = $mp->getPart('0x9d6ad00-0xa19ef48-0x9de7500-0xa4fae78-0xa382698');
$this->assertInstanceOf('BeSimple\SoapCommon\Mime\Part', $p1);
$this->assertEquals('binary', $p2->getHeader('Content-Transfer-Encoding'));
$this->assertEquals('application/binary', $p2->getHeader('Content-Type'));
$this->assertEquals(79, strlen($p2->getContent()));
@ -73,6 +75,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('MIMEBoundaryurn_uuid_2DB7ABF3DC5BED7FA51284209577582', $mp->getHeader('Content-Type', 'boundary'));
$p1 = $mp->getPart('0.urn:uuid:2DB7ABF3DC5BED7FA51284209577583@apache.org');
$this->assertInstanceOf('BeSimple\SoapCommon\Mime\Part', $p1);
$this->assertEquals('8bit', $p1->getHeader('Content-Transfer-Encoding'));
$this->assertEquals('application/soap+xml', $p1->getHeader('Content-Type'));
$this->assertEquals('utf-8', $p1->getHeader('Content-Type', 'charset'));
@ -98,6 +101,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('uuid:b71dc628-ec8f-4422-8a4a-992f041cb94c+id=46', $mp->getHeader('Content-Type', 'boundary'));
$p1 = $mp->getPart('http://tempuri.org/0');
$this->assertInstanceOf('BeSimple\SoapCommon\Mime\Part', $p1);
$this->assertEquals('8bit', $p1->getHeader('Content-Transfer-Encoding'));
$this->assertEquals('application/xop+xml', $p1->getHeader('Content-Type'));
$this->assertEquals('utf-8', $p1->getHeader('Content-Type', 'charset'));
@ -139,6 +143,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('100-continue', $mp->getHeader('Expect'));
$p1 = $mp->getPart('http://tempuri.org/0');
$this->assertInstanceOf('BeSimple\SoapCommon\Mime\Part', $p1);
$this->assertEquals('8bit', $p1->getHeader('Content-Transfer-Encoding'));
$this->assertEquals('application/xop+xml', $p1->getHeader('Content-Type'));
$this->assertEquals('utf-8', $p1->getHeader('Content-Type', 'charset'));
@ -146,6 +151,7 @@ class ParserTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(737, strlen($p1->getContent()));
$p2 = $mp->getPart('http://tempuri.org/1/632618206527087310');
$this->assertInstanceOf('BeSimple\SoapCommon\Mime\Part', $p1);
$this->assertEquals('binary', $p2->getHeader('Content-Transfer-Encoding'));
$this->assertEquals('application/octet-stream', $p2->getHeader('Content-Type'));
$this->assertEquals(769, strlen($p2->getContent()));