PageRenderTime 35ms CodeModel.GetById 6ms RepoModel.GetById 0ms app.codeStats 1ms

/vendor/symfony/yaml/Tests/Fixtures/YtsTypeTransfers.yml

https://gitlab.com/aegir/provision
YAML | 266 lines | 265 code | 1 blank | 0 comment | 0 complexity | f23cc9a4a8eb94571ac2d98e31c32743 MD5 | raw file
  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. [
  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. [
  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' => ['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. [
  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. [
  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. [
  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. ['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. [
  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. [
  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. [
  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. php: |
  179. [
  180. 'zero' => 0,
  181. 'simple' => 12,
  182. ]
  183. ---
  184. test: Positive Big Integer
  185. deprecated: true
  186. dump_skip: true
  187. brief: >
  188. An integer is a series of numbers, optionally
  189. starting with a positive or negative sign. Integers
  190. may also contain commas for readability.
  191. yaml: |
  192. one-thousand: 1,000
  193. php: |
  194. [
  195. 'one-thousand' => 1000.0,
  196. ]
  197. ---
  198. test: Negative Big Integer
  199. deprecated: true
  200. dump_skip: true
  201. brief: >
  202. An integer is a series of numbers, optionally
  203. starting with a positive or negative sign. Integers
  204. may also contain commas for readability.
  205. yaml: |
  206. negative one-thousand: -1,000
  207. php: |
  208. [
  209. 'negative one-thousand' => -1000.0
  210. ]
  211. ---
  212. test: Floats
  213. dump_skip: true
  214. brief: >
  215. Floats are represented by numbers with decimals,
  216. allowing for scientific notation, as well as
  217. positive and negative infinity and "not a number."
  218. yaml: |
  219. a simple float: 2.00
  220. scientific notation: 1.00009e+3
  221. php: |
  222. [
  223. 'a simple float' => 2.0,
  224. 'scientific notation' => 1000.09
  225. ]
  226. ---
  227. test: Larger Float
  228. dump_skip: true
  229. deprecated: true
  230. brief: >
  231. Floats are represented by numbers with decimals,
  232. allowing for scientific notation, as well as
  233. positive and negative infinity and "not a number."
  234. yaml: |
  235. larger float: 1,000.09
  236. php: |
  237. [
  238. 'larger float' => 1000.09,
  239. ]
  240. ---
  241. test: Time
  242. todo: true
  243. brief: >
  244. You can represent timestamps by using
  245. ISO8601 format, or a variation which
  246. allows spaces between the date, time and
  247. time zone.
  248. yaml: |
  249. iso8601: 2001-12-14t21:59:43.10-05:00
  250. space separated: 2001-12-14 21:59:43.10 -05:00
  251. php: |
  252. [
  253. 'iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),
  254. 'space separated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )
  255. ]
  256. ---
  257. test: Date
  258. todo: true
  259. brief: >
  260. A date can be represented by its year,
  261. month and day in ISO8601 order.
  262. yaml: |
  263. 1976-07-31
  264. php: |
  265. date( 1976, 7, 31 )