YtsTypeTransfers.yml

drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml

File

drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml
View source
  1. --- %YAML:1.0
  2. test: Strings
  3. brief: >
  4. Any group of characters beginning with an
  5. alphabetic or numeric character is a string,
  6. unless it belongs to one of the groups below
  7. (such as an Integer or Time).
  8. yaml: |
  9. String
  10. php: |
  11. 'String'
  12. ---
  13. test: String characters
  14. brief: >
  15. A string can contain any alphabetic or
  16. numeric character, along with many
  17. punctuation characters, including the
  18. period, dash, space, quotes, exclamation, and
  19. question mark.
  20. yaml: |
  21. - What's Yaml?
  22. - It's for writing data structures in plain text.
  23. - And?
  24. - And what? That's not good enough for you?
  25. - No, I mean, "And what about Yaml?"
  26. - Oh, oh yeah. Uh.. Yaml for Ruby.
  27. php: |
  28. array(
  29. "What's Yaml?",
  30. "It's for writing data structures in plain text.",
  31. "And?",
  32. "And what? That's not good enough for you?",
  33. "No, I mean, \"And what about Yaml?\"",
  34. "Oh, oh yeah. Uh.. Yaml for Ruby."
  35. )
  36. ---
  37. test: Indicators in Strings
  38. brief: >
  39. Be careful using indicators in strings. In particular,
  40. the comma, colon, and pound sign must be used carefully.
  41. yaml: |
  42. the colon followed by space is an indicator: but is a string:right here
  43. same for the pound sign: here we have it#in a string
  44. the comma can, honestly, be used in most cases: [ but not in, inline collections ]
  45. php: |
  46. array(
  47. 'the colon followed by space is an indicator' => 'but is a string:right here',
  48. 'same for the pound sign' => 'here we have it#in a string',
  49. 'the comma can, honestly, be used in most cases' => array('but not in', 'inline collections')
  50. )
  51. ---
  52. test: Forcing Strings
  53. brief: >
  54. Any YAML type can be forced into a string using the
  55. explicit !str method.
  56. yaml: |
  57. date string: !str 2001-08-01
  58. number string: !str 192
  59. php: |
  60. array(
  61. 'date string' => '2001-08-01',
  62. 'number string' => '192'
  63. )
  64. ---
  65. test: Single-quoted Strings
  66. brief: >
  67. You can also enclose your strings within single quotes,
  68. which allows use of slashes, colons, and other indicators
  69. freely. Inside single quotes, you can represent a single
  70. quote in your string by using two single quotes next to
  71. each other.
  72. yaml: |
  73. all my favorite symbols: '#:!/%.)'
  74. a few i hate: '&(*'
  75. why do i hate them?: 'it''s very hard to explain'
  76. entities: '£ me'
  77. php: |
  78. array(
  79. 'all my favorite symbols' => '#:!/%.)',
  80. 'a few i hate' => '&(*',
  81. 'why do i hate them?' => 'it\'s very hard to explain',
  82. 'entities' => '£ me'
  83. )
  84. ---
  85. test: Double-quoted Strings
  86. brief: >
  87. Enclosing strings in double quotes allows you
  88. to use escapings to represent ASCII and
  89. Unicode characters.
  90. yaml: |
  91. i know where i want my line breaks: "one here\nand another here\n"
  92. php: |
  93. array(
  94. 'i know where i want my line breaks' => "one here\nand another here\n"
  95. )
  96. ---
  97. test: Multi-line Quoted Strings
  98. todo: true
  99. brief: >
  100. Both single- and double-quoted strings may be
  101. carried on to new lines in your YAML document.
  102. They must be indented a step and indentation
  103. is interpreted as a single space.
  104. yaml: |
  105. i want a long string: "so i'm going to
  106. let it go on and on to other lines
  107. until i end it with a quote."
  108. php: |
  109. array('i want a long string' => "so i'm going to ".
  110. "let it go on and on to other lines ".
  111. "until i end it with a quote."
  112. )
  113. ---
  114. test: Plain scalars
  115. todo: true
  116. brief: >
  117. Unquoted strings may also span multiple lines, if they
  118. are free of YAML space indicators and indented.
  119. yaml: |
  120. - My little toe is broken in two places;
  121. - I'm crazy to have skied this way;
  122. - I'm not the craziest he's seen, since there was always the German guy
  123. who skied for 3 hours on a broken shin bone (just below the kneecap);
  124. - Nevertheless, second place is respectable, and he doesn't
  125. recommend going for the record;
  126. - He's going to put my foot in plaster for a month;
  127. - This would impair my skiing ability somewhat for the
  128. duration, as can be imagined.
  129. php: |
  130. array(
  131. "My little toe is broken in two places;",
  132. "I'm crazy to have skied this way;",
  133. "I'm not the craziest he's seen, since there was always ".
  134. "the German guy who skied for 3 hours on a broken shin ".
  135. "bone (just below the kneecap);",
  136. "Nevertheless, second place is respectable, and he doesn't ".
  137. "recommend going for the record;",
  138. "He's going to put my foot in plaster for a month;",
  139. "This would impair my skiing ability somewhat for the duration, ".
  140. "as can be imagined."
  141. )
  142. ---
  143. test: 'Null'
  144. brief: >
  145. You can use the tilde '~' character for a null value.
  146. yaml: |
  147. name: Mr. Show
  148. hosted by: Bob and David
  149. date of next season: ~
  150. php: |
  151. array(
  152. 'name' => 'Mr. Show',
  153. 'hosted by' => 'Bob and David',
  154. 'date of next season' => null
  155. )
  156. ---
  157. test: Boolean
  158. brief: >
  159. You can use 'true' and 'false' for Boolean values.
  160. yaml: |
  161. Is Gus a Liar?: true
  162. Do I rely on Gus for Sustenance?: false
  163. php: |
  164. array(
  165. 'Is Gus a Liar?' => true,
  166. 'Do I rely on Gus for Sustenance?' => false
  167. )
  168. ---
  169. test: Integers
  170. dump_skip: true
  171. brief: >
  172. An integer is a series of numbers, optionally
  173. starting with a positive or negative sign. Integers
  174. may also contain commas for readability.
  175. yaml: |
  176. zero: 0
  177. simple: 12
  178. one-thousand: 1,000
  179. negative one-thousand: -1,000
  180. php: |
  181. array(
  182. 'zero' => 0,
  183. 'simple' => 12,
  184. 'one-thousand' => 1000,
  185. 'negative one-thousand' => -1000
  186. )
  187. ---
  188. test: Integers as Map Keys
  189. brief: >
  190. An integer can be used a dictionary key.
  191. yaml: |
  192. 1: one
  193. 2: two
  194. 3: three
  195. php: |
  196. array(
  197. 1 => 'one',
  198. 2 => 'two',
  199. 3 => 'three'
  200. )
  201. ---
  202. test: Floats
  203. dump_skip: true
  204. brief: >
  205. Floats are represented by numbers with decimals,
  206. allowing for scientific notation, as well as
  207. positive and negative infinity and "not a number."
  208. yaml: |
  209. a simple float: 2.00
  210. larger float: 1,000.09
  211. scientific notation: 1.00009e+3
  212. php: |
  213. array(
  214. 'a simple float' => 2.0,
  215. 'larger float' => 1000.09,
  216. 'scientific notation' => 1000.09
  217. )
  218. ---
  219. test: Time
  220. todo: true
  221. brief: >
  222. You can represent timestamps by using
  223. ISO8601 format, or a variation which
  224. allows spaces between the date, time and
  225. time zone.
  226. yaml: |
  227. iso8601: 2001-12-14t21:59:43.10-05:00
  228. space seperated: 2001-12-14 21:59:43.10 -05:00
  229. php: |
  230. array(
  231. 'iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),
  232. 'space seperated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )
  233. )
  234. ---
  235. test: Date
  236. todo: true
  237. brief: >
  238. A date can be represented by its year,
  239. month and day in ISO8601 order.
  240. yaml: |
  241. 1976-07-31
  242. php: |
  243. date( 1976, 7, 31 )