mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 08:12:17 +09:00
Add unit tests for XMLRPC request parser
This commit is contained in:
parent
2407ad15df
commit
716b0e19bd
2 changed files with 40 additions and 0 deletions
20
tests/unit/framework/parsers/XmlrpcParserTest.php
Normal file
20
tests/unit/framework/parsers/XmlrpcParserTest.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
class XmlrpcParserTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
public function testParse()
|
||||
{
|
||||
$xml = file_get_contents(\RX_BASEDIR . 'tests/_data/xmlrpc/request.xml');
|
||||
$params = Rhymix\Framework\Parsers\XMLRPCParser::parse($xml);
|
||||
$this->assertTrue(is_array($params));
|
||||
$this->assertEquals('board', $params['module']);
|
||||
$this->assertEquals('procBoardInsertDocument', $params['act']);
|
||||
$this->assertEquals('제목', $params['title']);
|
||||
$this->assertEquals('<p>내용</p>' . "\n\t\t\t" . '<p>내용</p>' . "\n\t\t", $params['content']);
|
||||
$this->assertTrue(is_array($params['foobar']));
|
||||
$this->assertEquals('customvalue1', $params['foobar']['subkey1']);
|
||||
$this->assertEquals('customvalue2', $params['foobar']['subkey2']);
|
||||
$this->assertTrue(is_array($params['foobar']['subkey3']));
|
||||
$this->assertEquals('look here', $params['foobar']['subkey3']['subsubkey']);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue