mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Adding test case for XML class, conversion from Set object (Ticket #3696)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6193 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
c128439fef
commit
698af0115c
1 changed files with 45 additions and 2 deletions
|
@ -27,6 +27,7 @@
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
*/
|
*/
|
||||||
uses('xml');
|
uses('xml');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for class.
|
* Short description for class.
|
||||||
*
|
*
|
||||||
|
@ -47,8 +48,50 @@ class XMLNodeTest extends UnitTestCase {
|
||||||
*/
|
*/
|
||||||
class XMLTest extends UnitTestCase {
|
class XMLTest extends UnitTestCase {
|
||||||
|
|
||||||
function skip() {
|
function testSerialization() {
|
||||||
$this->skipif (true, 'XMLTest not implemented');
|
$input = array(
|
||||||
|
array(
|
||||||
|
'Project' => array(
|
||||||
|
'id' => 1,
|
||||||
|
'title' => null,
|
||||||
|
'client_id' => 1,
|
||||||
|
'show' => 1,
|
||||||
|
'is_spotlight' => null,
|
||||||
|
'style_id' => 0,
|
||||||
|
'job_type_id' => 1,
|
||||||
|
'industry_id' => 1,
|
||||||
|
'modified' => null,
|
||||||
|
'created' => null
|
||||||
|
),
|
||||||
|
'Style' => array('id' => null, 'name' => null),
|
||||||
|
'JobType' => array('id' => 1, 'name' => 'Touch Screen Kiosk'),
|
||||||
|
'Industry' => array('id' => 1, 'name' => 'Financial')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'Project' => array(
|
||||||
|
'id' => 2,
|
||||||
|
'title' => null,
|
||||||
|
'client_id' => 2,
|
||||||
|
'show' => 1,
|
||||||
|
'is_spotlight' => null,
|
||||||
|
'style_id' => 0,
|
||||||
|
'job_type_id' => 2,
|
||||||
|
'industry_id' => 2,
|
||||||
|
'modified' => '2007-11-26 14:48:36',
|
||||||
|
'created' => null
|
||||||
|
),
|
||||||
|
'Style' => array('id' => null, 'name' => null),
|
||||||
|
'JobType' => array('id' => 2, 'name' => 'Awareness Campaign'),
|
||||||
|
'Industry' => array('id' => 2, 'name' => 'Education')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$expected = '<project id="1" title="" client_id="1" show="1" is_spotlight="" style_id="0" job_type_id="1" industry_id="1" modified="" created=""><style id="" name="" /><job_type id="1" name="Touch Screen Kiosk" /><industry id="1" name="Financial" /></project><project id="2" title="" client_id="2" show="1" is_spotlight="" style_id="0" job_type_id="2" industry_id="2" modified="2007-11-26 14:48:36" created=""><style id="" name="" /><job_type id="2" name="Awareness Campaign" /><industry id="2" name="Education" /></project>';
|
||||||
|
|
||||||
|
$xml = new XML($input);
|
||||||
|
$result = $xml->compose(false);
|
||||||
|
$result = preg_replace("/\n/",'', $result);
|
||||||
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Add table
Reference in a new issue