From aa80057c8a6031cf276f8bb3073ebe36636266cb Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Sun, 1 Apr 2012 22:23:48 +0200 Subject: transformed inc/ixr unittests to phpunit --- _testing/unittests/inc/ixr_library_date.test.php | 36 ++++++ .../unittests/inc/ixr_library_ixr_message.test.php | 140 +++++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 _testing/unittests/inc/ixr_library_date.test.php create mode 100644 _testing/unittests/inc/ixr_library_ixr_message.test.php (limited to '_testing/unittests/inc') diff --git a/_testing/unittests/inc/ixr_library_date.test.php b/_testing/unittests/inc/ixr_library_date.test.php new file mode 100644 index 000000000..8b5f3e83e --- /dev/null +++ b/_testing/unittests/inc/ixr_library_date.test.php @@ -0,0 +1,36 @@ +assertEquals($dt->getTimeStamp(),$test[1]); + } + } + +} +//Setup VIM: ex: et ts=4 : diff --git a/_testing/unittests/inc/ixr_library_ixr_message.test.php b/_testing/unittests/inc/ixr_library_ixr_message.test.php new file mode 100644 index 000000000..9de3d61aa --- /dev/null +++ b/_testing/unittests/inc/ixr_library_ixr_message.test.php @@ -0,0 +1,140 @@ +wiki.getBackLinks change '; + + $ixrmsg = new IXR_Message($xml); + $ixrmsg->parse(); + + $this->assertEquals($ixrmsg->messageType,'methodCall'); + $this->assertEquals($ixrmsg->methodName,'wiki.getBackLinks'); + $this->assertEquals($ixrmsg->params,array(' change ')); + } + + function test_untypedvalue2(){ + $xml = ' + + wiki.getBackLinks + + + change + + + '; + + $ixrmsg = new IXR_Message($xml); + $ixrmsg->parse(); + + $this->assertEquals($ixrmsg->messageType,'methodCall'); + $this->assertEquals($ixrmsg->methodName,'wiki.getBackLinks'); + $this->assertEquals($ixrmsg->params,array(' change ')); + } + + function test_stringvalue1(){ + $xml = 'wiki.getBackLinks change '; + + $ixrmsg = new IXR_Message($xml); + $ixrmsg->parse(); + + $this->assertEquals($ixrmsg->messageType,'methodCall'); + $this->assertEquals($ixrmsg->methodName,'wiki.getBackLinks'); + $this->assertEquals($ixrmsg->params,array(' change ')); + } + + function test_stringvalue2(){ + $xml = ' + + wiki.getBackLinks + + + + change + + + + '; + + $ixrmsg = new IXR_Message($xml); + $ixrmsg->parse(); + + $this->assertEquals($ixrmsg->messageType,'methodCall'); + $this->assertEquals($ixrmsg->methodName,'wiki.getBackLinks'); + $this->assertEquals($ixrmsg->params,array(' change ')); + } + + function test_emptyvalue1(){ + $xml = 'wiki.getBackLinks'; + + $ixrmsg = new IXR_Message($xml); + $ixrmsg->parse(); + + $this->assertEquals($ixrmsg->messageType,'methodCall'); + $this->assertEquals($ixrmsg->methodName,'wiki.getBackLinks'); + $this->assertEquals($ixrmsg->params,array('')); + } + + function test_emptyvalue2(){ + $xml = ' + + wiki.getBackLinks + + + + + + + + '; + + $ixrmsg = new IXR_Message($xml); + $ixrmsg->parse(); + + $this->assertEquals($ixrmsg->messageType,'methodCall'); + $this->assertEquals($ixrmsg->methodName,'wiki.getBackLinks'); + $this->assertEquals($ixrmsg->params,array('')); + } + + function test_struct(){ + $xml = ' + + wiki.putPage + + + start + + + test text + + + + + sum + xmlrpc edit + + + minor + 1 + + + + + '; + + $ixrmsg = new IXR_Message($xml); + $ixrmsg->parse(); + + $this->assertEquals($ixrmsg->messageType,'methodCall'); + $this->assertEquals($ixrmsg->methodName,'wiki.putPage'); + $this->assertEquals($ixrmsg->params,array('start','test text',array('sum'=>'xmlrpc edit','minor'=>'1'))); + } + +} +//Setup VIM: ex: et ts=4 : -- cgit v1.2.3