Development

Changeset 10575

You must first sign up to be able to contribute.

Changeset 10575

Show
Ignore:
Timestamp:
08/01/08 15:08:42 (4 months ago)
Author:
nicolas
Message:

[1.2] backport of r10574 - fixed sfYaml::dump misunderstands hash as array (refs #4025)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/yaml/sfYamlDumper.class.php

    r8488 r10575  
    4141    else 
    4242    { 
    43       $isAHash = count(array_diff_key($input, array_fill(0, count($input), true))); 
     43      $isAHash = array_keys($input) !== range(0, count($input) - 1); 
    4444 
    4545      foreach ($input as $key => $value) 
  • branches/1.2/test/unit/yaml/fixtures/sfTests.yml

    r8869 r10575  
    9292php: | 
    9393  array('foo', array('bar' => array('bar' => 'foo'))) 
     94--- 
     95test: A sequence with an unordered array 
     96brief: > 
     97  A sequence with an unordered array 
     98yaml: | 
     99  1: foo 
     100  0: bar 
     101php: | 
     102  array(1 => 'foo', 0 => 'bar') 
  • branches/1.2/test/unit/yaml/sfYamlDumperTest.php

    r8924 r10575  
    1313require_once(dirname(__FILE__).'/../../../lib/yaml/sfYamlDumper.class.php'); 
    1414 
    15 $t = new lime_test(140, new lime_output_color()); 
     15$t = new lime_test(141, new lime_output_color()); 
    1616 
    1717$parser = new sfYamlParser(); 
  • branches/1.2/test/unit/yaml/sfYamlParserTest.php

    r8923 r10575  
    1212require_once(dirname(__FILE__).'/../../../lib/yaml/sfYamlParser.class.php'); 
    1313 
    14 $t = new lime_test(140, new lime_output_color()); 
     14$t = new lime_test(141, new lime_output_color()); 
    1515 
    1616$parser = new sfYamlParser();