Development

Changeset 7892

You must first sign up to be able to contribute.

Changeset 7892

Show
Ignore:
Timestamp:
03/14/08 22:59:38 (7 months ago)
Author:
fabien
Message:

replaced Spyc with a new YAML parser/dumper (closes #3083, #2887, #2622, #2514, #1966, #1339, #3016)

  • removed Spyc
  • added sfYamlParser, sfYamlDumper (should be totally BC thanks to the unit tests)
  • the parser and the dumper are much more robust and much more easier to fix
  • exceptions are thrown when a non valid YAML file is parsed (when you forget a : after a key for example, or if the indentation is not right ;))
  • fixed a bunch of bugs of the old parser
  • speed is more or less the same as Spyc
  • added an option to control the dump to switch from the block to the flow notation (propel:build-schema is now much more readable in YAML)
  • added more unit tests
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/COPYRIGHT

    r7792 r7892  
    6464License:   BSD - see licenses/LICENSE.prado file 
    6565 
    66 Spyc 
    67 ---- 
    68  
    69 symfony contains the Spyc software 
    70  
    71 Url:       http://spyc.sourceforge.net/ 
    72 Copyright: 2005-2006 Chris Wanstrath 
    73 License:   MIT - http://www.opensource.org/licenses/mit-license.php 
    74  
    7566lime 
    7667---- 
  • branches/1.1/lib/autoload/sfCoreAutoload.class.php

    r7757 r7892  
    353353  'sfToolkit' => 'util', 
    354354  'sfYaml' => 'util', 
     355  'sfYamlDumper' => 'util', 
    355356  'sfYamlInline' => 'util', 
    356   'Spyc' => 'util', 
     357  'sfYamlParser' => 'util', 
    357358  'sfValidatorI18nChoiceCountry' => 'validator/i18n', 
    358359  'sfValidatorI18nChoiceLanguage' => 'validator/i18n', 
  • branches/1.1/lib/config/sfYamlConfigHandler.class.php

    r7811 r7892  
    6262    $config = sfYaml::load($configFile); 
    6363 
    64     if ($config === false || $config === null
     64    if ($config === false
    6565    { 
    6666      // configuration couldn't be parsed 
  • branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/sfPropelData.class.php

    r7639 r7892  
    283283    if (!is_dir($directory_or_file)) 
    284284    { 
    285       file_put_contents($directory_or_file, sfYaml::dump($dumpData)); 
     285      file_put_contents($directory_or_file, sfYaml::dump($dumpData, 3)); 
    286286    } 
    287287    else 
     
    295295        } 
    296296 
    297         file_put_contents(sprintf("%s/%03d-%s.yml", $directory_or_file, ++$i, $tableName), sfYaml::dump(array($tableName => $dumpData[$tableName]))); 
     297        file_put_contents(sprintf("%s/%03d-%s.yml", $directory_or_file, ++$i, $tableName), sfYaml::dump(array($tableName => $dumpData[$tableName]), 3)); 
    298298      } 
    299299    } 
  • branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/sfPropelDatabaseSchema.class.php

    r7394 r7892  
    898898  public function asYAML() 
    899899  { 
    900     return sfYaml::dump(array($this->connection_name => $this->database)); 
     900    return sfYaml::dump(array($this->connection_name => $this->database), 3); 
    901901  } 
    902902 
  • branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataDumpTask.class.php

    r7614 r7892  
    9191    else 
    9292    { 
    93       fwrite(STDOUT, sfYaml::dump($data->getData('all', $options['connection']))); 
     93      fwrite(STDOUT, sfYaml::dump($data->getData('all', $options['connection']), 3)); 
    9494    } 
    9595  } 
  • branches/1.1/lib/task/configure/sfConfigureDatabaseTask.class.php

    r7010 r7892  
    8686    ); 
    8787 
    88     file_put_contents($file, sfYaml::dump($config)); 
     88    file_put_contents($file, sfYaml::dump($config, 4)); 
    8989 
    9090    // update propel.ini 
  • branches/1.1/lib/util/sfYaml.class.php

    r7889 r7892  
    4545    } 
    4646 
    47     // syck is prefered over spyc 
     47    // syck is prefered over sfYamlParser 
    4848    if (function_exists('syck_load')) 
    4949    { 
     
    5454    else 
    5555    { 
    56       require_once(dirname(__FILE__).'/Spyc.class.php'); 
     56      require_once dirname(__FILE__).'/sfYamlParser.class.php'; 
     57      $yaml = new sfYamlParser(); 
    5758 
    58       $spyc = new Spyc(); 
    59  
    60       return $spyc->load($input); 
     59      return $yaml->parse($input); 
    6160    } 
    6261  } 
     
    7271   * @return string 
    7372   */ 
    74   public static function dump($array
     73  public static function dump($array, $inline = 2
    7574  { 
    7675    if (function_exists('syck_dump')) 
     
    8079    else 
    8180    { 
    82       require_once(dirname(__FILE__).'/Spyc.class.php'); 
     81      require_once dirname(__FILE__).'/sfYamlDumper.class.php'; 
     82      $yaml = new sfYamlDumper(); 
    8383 
    84       $spyc = new Spyc(); 
    85  
    86       return $spyc->dump($array, false, 0); 
     84      return $yaml->dump($array, $inline); 
    8785    } 
    8886  } 
  • branches/1.1/lib/util/sfYamlInline.class.php

    r7886 r7892  
    8181      case preg_match(self::getTimestampRegex(), $value): 
    8282        return "'$value'"; 
     83      case in_array(strtolower($value), array('true', 'on', '+', 'yes', 'y')): 
     84        return "'$value'"; 
     85      case in_array(strtolower($value), array('false', 'off', '-', 'no', 'n')): 
     86        return "'$value'"; 
    8387      default: 
    8488        return $value; 
  • branches/1.1/test/unit/util/fixtures/yaml/YtsDocumentSeparator.yml

    r2203 r7892  
    11--- %YAML:1.0  
    22test: Trailing Document Separator  
     3todo: true 
    34brief: >  
    45    You can separate YAML documents  
     
    1920---  
    2021test: Leading Document Separator  
     22todo: true 
    2123brief: > 
    2224    You can explicity give an opening  
     
    3840---  
    3941test: YAML Header  
     42todo: true 
    4043brief: >  
    4144    The opening separator can contain directives  
     
    4649    foo: 1  
    4750    bar: 2  
    48 python: |  
    49     [  
    50         { 'foo': 1, 'bar': 2 }  
    51     ]  
    52 ruby: |  
    53     y = YAML::Stream.new  
    54     y.add( { 'foo' => 1, 'bar' => 2 } )  
     51php: |  
     52    array('foo' => 1, 'bar' => 2) 
    5553documents: 1  
    5654  
     
    6563    foo: | 
    6664        --- 
    67 python: |  
    68     [  
    69         { 'foo': "---\n" }  
    70     ]  
    71 ruby: |  
    72     { 'foo' => "---\n" }  
     65php: |  
     66    array('foo' => "---\n") 
    7367  
    7468---  
     
    8579    bar: |  
    8680        fooness 
    87 python: |  
    88     [  
    89         {  'foo': flushLeft("""  
    90             ---  
    91             foo: bar  
    92             ---  
    93             yo: baz  
    94             """),  
    95            'bar': "fooness\n"  
    96         }  
    97     ]  
    98 ruby: |  
    99     {  
     81php: |  
     82    array(  
    10083       'foo' => "---\nfoo: bar\n---\nyo: baz\n",  
    10184       'bar' => "fooness\n"  
    102     }  
     85    ) 
  • branches/1.1/test/unit/util/fixtures/yaml/YtsErrorTests.yml

    r2203 r7892  
    11---  
    22test: Missing value for hash item  
     3todo: true 
    34brief: |  
    45    Third item in this hash doesn't have a value  
     
    2122    firstline: 1  
    2223    secondline: 2  
    23 python-error: Inadequate indentation  
     24php: | 
     25  array('foo' => null, 'firstline' => 1, 'secondline' => 2) 
     26 
  • branches/1.1/test/unit/util/fixtures/yaml/YtsFlowCollections.yml

    r2203 r7892  
    4949    ) 
    5050---  
    51 test: Commas in Values  
     51test: Commas in Values (not in the spec!) 
    5252todo: true 
    5353brief: >  
  • branches/1.1/test/unit/util/fixtures/yaml/YtsFoldedScalars.yml

    r2203 r7892  
    1212        Foo 
    1313        Bar 
    14  
    15 ruby: |  
    16     { 'this' => "Foo\nBar\n" }  
    17 python: |  
    18     [   
    19         { 'this': "Foo\nBar\n" }  
    20     ]  
     14php: |  
     15    array('this' => "Foo\nBar\n") 
    2116---  
    2217test: The '+' indicator  
     
    3328 
    3429    dummy: value 
    35 ruby: |  
    36     {  
     30php: |  
     31    array(  
    3732        'normal' => "extra new lines not kept\n",  
    3833        'preserving' => "extra new lines are kept\n\n\n",  
    3934        'dummy' => 'value'  
    40     }  
    41 python: |  
    42     [ {  
    43         'normal': "extra new lines not kept\n",  
    44         'preserving': "extra new lines are kept\n\n\n",  
    45         'dummy': 'value'  
    46     } ]  
     35    )  
    4736---  
    4837test: Three trailing newlines in literals  
     
    7564 
    7665    same as "kept" above: "This has four newlines.\n\n\n\n" 
    77 ruby: | 
    78     {   
     66php: | 
     67    array(   
    7968      'clipped' => "This has one newline.\n",  
    8069      'same as "clipped" above' => "This has one newline.\n",  
     
    8372      'kept' => "This has four newlines.\n\n\n\n",  
    8473      'same as "kept" above' => "This has four newlines.\n\n\n\n"  
    85     }  
    86 not_yet_in_python: |  
    87     [  
    88     {   
    89       'clipped': "This has one newline.\n",  
    90       'same as "clipped" above': "This has one newline.\n",  
    91       'stripped': 'This has no newline.',  
    92       'same as "stripped" above': 'This has no newline.',  
    93       'kept': "This has four newlines.\n\n\n\n",  
    94       'same as "kept" above': "This has four newlines.\n\n\n\n"  
    95     }  
    96     ]  
    97   
     74    ) 
    9875---  
    9976test: Extra trailing newlines with spaces 
     77todo: true 
    10078brief: > 
    10179    Normally, only a single newline is kept  
     
    11795 
    11896           
    119 ruby: |  
    120     { 'this' => "Foo\n\n  \n",   
    121       'kept' => "Foo\n\n  \n" }  
     97php: |  
     98    array('this' => "Foo\n\n  \n",   
     99      'kept' => "Foo\n\n  \n" ) 
    122100  
    123101---  
     
    137115        hmm 
    138116    - dog 
    139 python: |  
    140     [  
    141         [  
    142             'apple',   
    143             'banana',   
    144             "can't you see the beauty of yaml? hmm\n",  
    145             'dog'  
    146         ]  
    147     ]  
    148 ruby: |  
    149     [  
     117php: |  
     118    array(  
    150119        'apple',   
    151120        'banana',   
    152121        "can't you see the beauty of yaml? hmm\n",  
    153122        'dog'  
    154     ]  
     123    ) 
    155124---  
    156125test: Folded Block as a Mapping Value  
     
    166135        by a knee injury. 
    167136    source: espn 
    168 python: | 
    169     [  
    170         {   
    171             'quote': "Mark McGwire's year was crippled by a knee injury.\n",  
    172             'source': 'espn'  
    173         }  
    174     ]  
    175 ruby: |  
    176     {   
     137php: | 
     138    array(  
    177139        'quote' => "Mark McGwire's year was crippled by a knee injury.\n",  
    178140        'source' => 'espn'  
    179     }  
    180   
     141    )  
    181142---  
    182143test: Three trailing newlines in folded blocks  
     
    205166 
    206167    same as "kept" above: "This has four newlines.\n\n\n\n" 
    207 ruby: | 
    208     {   
     168php: | 
     169    array(   
    209170      'clipped' => "This has one newline.\n",  
    210171      'same as "clipped" above' => "This has one newline.\n",  
     
    213174      'kept' => "This has four newlines.\n\n\n\n",  
    214175      'same as "kept" above' => "This has four newlines.\n\n\n\n"  
    215     }  
     176    ) 
  • branches/1.1/test/unit/util/fixtures/yaml/YtsNullsAndEmpties.yml

    r2499 r7892  
    3131---   
    3232test: Null as Document  
    33 todo: true 
    3433yaml: |  
    3534    ~  
     
    3837---  
    3938test: Empty String  
    40 todo: true 
    4139brief: >  
    4240    You can represent an empty string  
  • branches/1.1/test/unit/util/fixtures/yaml/YtsSpecificationExamples.yml

    r2203 r7892  
    66  - Sammy Sosa  
    77  - Ken Griffey  
    8 perl: |  
    9   [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ]  
    10 python: |  
    11   [ ['Mark McGwire', 'Sammy Sosa', 'Ken Griffey'] ]  
    12 ruby: |  
    13   [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ]  
    14 syck: | 
    15   struct test_node seq[] = { 
    16       { T_STR, 0, "Mark McGwire" }, 
    17       { T_STR, 0, "Sammy Sosa" }, 
    18       { T_STR, 0, "Ken Griffey" }, 
    19       end_node 
    20   }; 
    21   struct test_node stream[] = { 
    22       { T_SEQ, 0, 0, seq }, 
    23       end_node 
    24   }; 
    25   
     8php: |  
     9  array('Mark McGwire', 'Sammy Sosa', 'Ken Griffey') 
    2610---  
    2711test: Mapping of scalars to scalars  
     
    3115  avg: 0.278  
    3216  rbi: 147  
    33 perl: |  
    34   { hr => 65, avg => 0.278, rbi => 147 }  
    35 python: |  
    36   [ {'hr': 65, 'avg': .278, 'rbi': 147} ]  
    37 ruby: |  
    38   { 'hr' => 65, 'avg' => 0.278, 'rbi' => 147 }  
    39 syck: | 
    40   struct test_node map[] = { 
    41       { T_STR, 0, "hr" }, 
    42           { T_STR, 0, "65" }, 
    43       { T_STR, 0, "avg" }, 
    44           { T_STR, 0, "0.278" }, 
    45       { T_STR, 0, "rbi" }, 
    46           { T_STR, 0, "147" }, 
    47       end_node 
    48   }; 
    49   struct test_node stream[] = { 
    50       { T_MAP, 0, 0, map }, 
    51       end_node 
    52   }; 
    53   
     17php: |  
     18  array('hr' => 65, 'avg' => 0.278, 'rbi' => 147) 
    5419---  
    5520test: Mapping of scalars to sequences  
     
    6429       - Chicago Cubs  
    6530       - Atlanta Braves  
    66 perl: |  
    67     { american =>   
    68         [ 'Boston Red Sox', 'Detroit Tigers',   
    69           'New York Yankees' ],  
    70       national =>  
    71         [ 'New York Mets', 'Chicago Cubs',   
    72           'Atlanta Braves' ]   
    73     }  
    74 python: |  
    75     [  
    76     {  
    77     'american':   
    78         ['Boston Red Sox', 'Detroit Tigers',   
    79         'New York Yankees'],  
    80     'national':  
    81         ['New York Mets', 'Chicago Cubs',  
    82         'Atlanta Braves']  
    83     }  
    84     ]  
    85 ruby: |  
    86     { 'american' =>   
    87         [ 'Boston Red Sox', 'Detroit Tigers',   
    88           'New York Yankees' ],  
     31php: |  
     32    array('american' =>   
     33        array( 'Boston Red Sox', 'Detroit Tigers',   
     34          'New York Yankees' ),  
    8935      'national' =>  
    90         [ 'New York Mets', 'Chicago Cubs',   
    91           'Atlanta Braves' ]   
    92     }  
    93 syck: | 
    94   struct test_node seq1[] = { 
    95       { T_STR, 0, "Boston Red Sox" }, 
    96       { T_STR, 0, "Detroit Tigers" }, 
    97       { T_STR, 0, "New York Yankees" }, 
    98       end_node 
    99   }; 
    100   struct test_node seq2[] = { 
    101       { T_STR, 0, "New York Mets" }, 
    102       { T_STR, 0, "Chicago Cubs" }, 
    103       { T_STR, 0, "Atlanta Braves" }, 
    104       end_node 
    105   }; 
    106   struct test_node map[] = { 
    107       { T_STR, 0, "american" }, 
    108           { T_SEQ, 0, 0, seq1 }, 
    109       { T_STR, 0, "national" }, 
    110           { T_SEQ, 0, 0, seq2 }, 
    111       end_node 
    112   }; 
    113   struct test_node stream[] = { 
    114       { T_MAP, 0, 0, map }, 
    115       end_node 
    116   }; 
    117   
     36        array( 'New York Mets', 'Chicago Cubs',   
     37          'Atlanta Braves' ) 
     38    )  
    11839---  
    11940test: Sequence of mappings  
     
    12849      hr:   63  
    12950      avg:  0.288  
    130 perl: |  
    131     [  
    132       {name => 'Mark McGwire', hr => 65, avg => 0.278},  
    133       {name => 'Sammy Sosa',   hr => 63, avg => 0.288}  
    134     ]  
    135 python: |  
    136     [[   
    137         {  
    138         'name': 'Mark McGwire',  
    139         'hr': 65,  
    140         'avg': 0.278 
    141         },  
    142         {  
    143         'name': 'Sammy Sosa',  
    144         'hr': 63,  
    145         'avg': 0.288 
    146         }  
    147     ]]  
    148 ruby: |  
    149     [  
    150       {'name' => 'Mark McGwire', 'hr' => 65, 'avg' => 0.278},  
    151       {'name' => 'Sammy Sosa', 'hr' => 63, 'avg' => 0.288}  
    152     ]  
    153 syck: | 
    154   struct test_node map1[] = { 
    155       { T_STR, 0, "name" }, 
    156           { T_STR, 0, "Mark McGwire" }, 
    157       { T_STR, 0, "hr" }, 
    158           { T_STR, 0, "65" }, 
    159       { T_STR, 0, "avg" }, 
    160           { T_STR, 0, "0.278" }, 
    161       end_node 
    162   }; 
    163   struct test_node map2[] = { 
    164       { T_STR, 0, "name" }, 
    165           { T_STR, 0, "Sammy Sosa" }, 
    166       { T_STR, 0, "hr" }, 
    167           { T_STR, 0, "63" }, 
    168       { T_STR, 0, "avg" }, 
    169           { T_STR, 0, "0.288" }, 
    170       end_node 
    171   }; 
    172   struct test_node seq[] = { 
    173       { T_MAP, 0, 0, map1 }, 
    174       { T_MAP, 0, 0, map2 }, 
    175       end_node 
    176   }; 
    177   struct test_node stream[] = { 
    178       { T_SEQ, 0, 0, seq }, 
    179       end_node 
    180   }; 
    181   
     51php: |  
     52    array(  
     53      array('name' => 'Mark McGwire', 'hr' => 65, 'avg' => 0.278),  
     54      array('name' => 'Sammy Sosa', 'hr' => 63, 'avg' => 0.288)  
     55    ) 
    18256---  
    18357test: Legacy A5  
     58todo: true 
    18459spec: legacy_A5  
    18560yaml: |  
     
    254129---  
    255130test: Sequence of sequences  
     131todo: true 
    256132spec: 2.5 
    257133yaml: |  
     
    309185---  
    310186test: Mapping of mappings  
     187todo: true 
    311188spec: 2.6 
    312189yaml: |  
     
    365242test: Two documents in a stream each with a 
    366243      leading comment 
     244todo: true 
    367245spec: 2.7  
    368246yaml: |  
     
    410288---  
    411289test: Play by play feed from a game 
     290todo: true 
    412291spec: 2.8 
    413292yaml: |  
     
    458337---  
    459338test: Single document with two comments  
     339todo: true 
    460340spec: 2.9 
    461341yaml: |  
     
    507387---  
    508388test: Node for Sammy Sosa appears twice in this document  
     389todo: true 
    509390spec: 2.10  
    510391yaml: |  
     
    559440---  
    560441test: Mapping between sequences  
     442todo: true 
    561443spec: 2.11 
    562444yaml: |  
     
    611493---  
    612494test: Sequence key shortcut  
     495todo: true 
    613496spec: 2.12 
    614497yaml: |  
     
    676559---  
    677560test: Literal perserves newlines  
     561todo: true 
    678562spec: 2.13 
    679563yaml: |  
     
    703587---  
    704588test: Folded treats newlines as a space  
     589todo: true 
    705590spec: 2.14 
    706591yaml: |  
     
    723608---  
    724609test: Newlines preserved for indented and blank lines  
     610todo: true 
    725611spec: 2.15 
    726612yaml: |  
  • branches/1.1/test/unit/util/fixtures/yaml/YtsTypeTransfers.yml

    r2203 r7892  
    11--- %YAML:1.0  
    22test: Strings  
    3 todo: true 
    43brief: >  
    54    Any group of characters beginning with an  
     
    3736---  
    3837test: Indicators in Strings  
    39 todo: true 
    4038brief: >  
    4139    Be careful using indicators in strings.  In particular,  
     
    5351---  
    5452test: Forcing Strings  
    55 todo: true 
    5653brief: >  
    5754    Any YAML type can be forced into a string using the  
     
    6764---  
    6865test: Single-quoted Strings  
    69 todo: true 
    7066brief: >  
    7167    You can also enclose your strings within single quotes,  
     
    8682---  
    8783test: Double-quoted Strings  
    88 todo: true 
    8984brief: >  
    9085    Enclosing strings in double quotes allows you  
     
    172167---  
    173168test: Integers  
    174 todo: true 
    175169brief: >  
    176170    An integer is a series of numbers, optionally  
     
    205199---  
    206200test: Floats  
    207 todo: true 
    208201brief: >  
    209202     Floats are represented by numbers with decimals,  
     
    233226php: |  
    234227    array( 
    235       'iso8601' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),  
    236       'space seperated' => YAML::mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )  
     228      'iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),  
     229      'space seperated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )  
    237230    ) 
    238231---  
     
    245238    1976-07-31 
    246239php: |  
    247     Date.new( 1976, 7, 31 )  
     240    date( 1976, 7, 31 )  
  • branches/1.1/test/unit/util/fixtures/yaml/index.yml

    r3186 r7892  
     1- sfComments 
     2- sfTests 
     3#- YtsAnchorAlias 
    14- YtsBasicTests 
    25- YtsBlockMapping 
     6- YtsDocumentSeparator 
     7- YtsErrorTests 
    38- YtsFlowCollections 
    4 - YtsTypeTransfers 
    5 #- YtsFoldedScalars 
    6 #- YtsAnchorAlias 
    7 #- YtsDocumentSeparator 
     9- YtsFoldedScalars 
    810- YtsNullsAndEmpties 
    911#- YtsSpecificationExamples 
    10 - sfComments 
    11 - sfTests 
     12- YtsTypeTransfers 
  • branches/1.1/test/unit/util/fixtures/yaml/sfComments.yml

    r2918 r7892  
    99php: |  
    1010    array('ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar') 
     11--- 
     12test: Comments in the middle 
     13brief: > 
     14  Comments in the middle 
     15yaml: | 
     16    foo: 
     17    # some comment 
     18    # some comment 
     19      bar: foo 
     20    # some comment 
     21    # some comment 
     22php: | 
     23    array('foo' => array('bar' => 'foo')) 
  • branches/1.1/test/unit/util/fixtures/yaml/sfTests.yml

    r3599 r7892  
    77php: |  
    88    array('stripped_title' => array('name' => 'foo bar', 'help' => 'bar foo')) 
    9  
     9--- 
    1010test: Empty sequence 
    1111yaml: |  
     
    1313php: | 
    1414    array('foo' => array()) 
    15  
     15--- 
    1616test: Inline string parsing 
    1717brief: > 
     
    2121php: | 
    2222    array('test' => array('complex: string', 'another [string]')) 
     23--- 
     24test: Boolean 
     25brief: > 
     26    Boolean 
     27yaml: | 
     28    - false 
     29    - - 
     30    - off 
     31    - no 
     32    - true 
     33    - + 
     34    - on 
     35    - yes 
     36    - 'false' 
     37    - '-' 
     38    - 'off' 
     39    - 'no' 
     40    - 'true' 
     41    - '+' 
     42    - 'on' 
     43    - 'yes' 
     44php: | 
     45    array( 
     46      false, 
     47      false, 
     48      false, 
     49      false, 
     50      true, 
     51      true, 
     52      true, 
     53      true, 
     54      'false', 
     55      '-', 
     56      'off', 
     57      'no', 
     58      'true', 
     59      '+', 
     60      'on', 
     61      'yes', 
     62    ) 
  • branches/1.1/test/unit/util/sfYamlInlineTest.php

    r7886 r7892  
    8686 
    8787  // mappings 
    88   '{ foo: bar, bar: foo, false: false, null: null, integer: 12 }' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12), 
     88  '{ foo: bar, bar: foo, \'false\': false, null: null, integer: 12 }' => array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12), 
    8989  '{ foo: bar, bar: \'foo: bar\' }' => array('foo' => 'bar', 'bar' => 'foo: bar'), 
    9090