Index: trunk/phase3/tests/phpunit/includes/XmlTest.php |
— | — | @@ -325,12 +325,12 @@ |
326 | 326 | |
327 | 327 | function testEncodeJsVarArray() { |
328 | 328 | $this->assertEquals( |
329 | | - '["a", 1]', |
| 329 | + '["a",1]', |
330 | 330 | Xml::encodeJsVar( array( 'a', 1 ) ), |
331 | 331 | 'encodeJsVar() with array' |
332 | 332 | ); |
333 | 333 | $this->assertEquals( |
334 | | - '{"a": "a", "b": 1}', |
| 334 | + '{"a":"a","b":1}', |
335 | 335 | Xml::encodeJsVar( array( 'a' => 'a', 'b' => 1 ) ), |
336 | 336 | 'encodeJsVar() with associative array' |
337 | 337 | ); |
— | — | @@ -338,7 +338,7 @@ |
339 | 339 | |
340 | 340 | function testEncodeJsVarObject() { |
341 | 341 | $this->assertEquals( |
342 | | - '{"a": "a", "b": 1}', |
| 342 | + '{"a":"a","b":1}', |
343 | 343 | Xml::encodeJsVar( (object)array( 'a' => 'a', 'b' => 1 ) ), |
344 | 344 | 'encodeJsVar() with object' |
345 | 345 | ); |
Index: trunk/phase3/includes/Xml.php |
— | — | @@ -630,7 +630,7 @@ |
631 | 631 | $s = '['; |
632 | 632 | foreach ( $value as $elt ) { |
633 | 633 | if ( $s != '[' ) { |
634 | | - $s .= ', '; |
| 634 | + $s .= ','; |
635 | 635 | } |
636 | 636 | $s .= self::encodeJsVar( $elt ); |
637 | 637 | } |
— | — | @@ -642,10 +642,10 @@ |
643 | 643 | $s = '{'; |
644 | 644 | foreach ( (array)$value as $name => $elt ) { |
645 | 645 | if ( $s != '{' ) { |
646 | | - $s .= ', '; |
| 646 | + $s .= ','; |
647 | 647 | } |
648 | 648 | |
649 | | - $s .= '"' . self::escapeJsString( $name ) . '": ' . |
| 649 | + $s .= '"' . self::escapeJsString( $name ) . '":' . |
650 | 650 | self::encodeJsVar( $elt ); |
651 | 651 | } |
652 | 652 | $s .= '}'; |